summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-06 02:37:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-06 02:48:09 +0100
commit26c2e3bf1a7127fd2e19f23cbfa29c3f999ecdb9 (patch)
tree02c898cbb6e65179bf3894e72fe4b665f095799a /libavcodec/mpegvideo_enc.c
parentd5050bae801ff789c188d9e426dae6018a5f709f (diff)
parent381a722562bcc0b623acf6a00a583fe989bcb72a (diff)
Merge commit '381a722562bcc0b623acf6a00a583fe989bcb72a'
* commit '381a722562bcc0b623acf6a00a583fe989bcb72a': mpegvideo: split the encoding-only parts of ff_MPV_frame_end() into a separate function Conflicts: libavcodec/mpegvideo.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index ff44268f4a..78fff3c67b 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1487,6 +1487,41 @@ no_output_pic:
return 0;
}
+static void frame_end(MpegEncContext *s)
+{
+ int i;
+
+ if (s->unrestricted_mv &&
+ s->current_picture.reference &&
+ !s->intra_only) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
+ int hshift = desc->log2_chroma_w;
+ int vshift = desc->log2_chroma_h;
+ s->dsp.draw_edges(s->current_picture.f.data[0], s->linesize,
+ s->h_edge_pos, s->v_edge_pos,
+ EDGE_WIDTH, EDGE_WIDTH,
+ EDGE_TOP | EDGE_BOTTOM);
+ s->dsp.draw_edges(s->current_picture.f.data[1], s->uvlinesize,
+ s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
+ EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
+ EDGE_TOP | EDGE_BOTTOM);
+ s->dsp.draw_edges(s->current_picture.f.data[2], s->uvlinesize,
+ s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
+ EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
+ EDGE_TOP | EDGE_BOTTOM);
+ }
+
+ emms_c();
+
+ s->last_pict_type = s->pict_type;
+ s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f.quality;
+ if (s->pict_type!= AV_PICTURE_TYPE_B)
+ s->last_non_b_pict_type = s->pict_type;
+
+ s->avctx->coded_frame = &s->current_picture_ptr->f;
+
+}
+
int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
AVFrame *pic_arg, int *got_packet)
{
@@ -1542,7 +1577,7 @@ vbv_retry:
avctx->p_count = s->mb_num - s->i_count - s->skip_count;
avctx->skip_count = s->skip_count;
- ff_MPV_frame_end(s);
+ frame_end(s);
if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG)
ff_mjpeg_encode_picture_trailer(s);