aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-07 11:50:17 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-07 11:50:17 +0100
commit8cc5481d51bf746d9d43348af711dbf201bf336a (patch)
tree0a4102445621aecf2e34d8a6ee853e97d73525eb /libavcodec/h264.c
parent47f1af47b6cb763452c5bab3704ca965fccad25b (diff)
parent54b298fe5650c124c29a8283cfd05024ac409d3a (diff)
downloadffmpeg-8cc5481d51bf746d9d43348af711dbf201bf336a.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: lavc: Deprecate the deinterlace functions in libavcodec h264: Integrate draw_horiz_band into ff_h264_draw_horiz_band Conflicts: configure ffmpeg_opt.c libavcodec/avcodec.h libavcodec/h264.c libavcodec/imgconvert.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 2960bae174..3a83b4b031 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -143,28 +143,30 @@ static void h264_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
ff_h264_hl_decode_mb(h);
}
-static void draw_horiz_band(AVCodecContext *avctx, Picture *cur,
- Picture *last, int y, int h, int picture_structure,
- int first_field, int low_delay)
+void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
{
+ AVCodecContext *avctx = h->avctx;
+ Picture *cur = &h->cur_pic;
+ Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
int vshift = desc->log2_chroma_h;
- const int field_pic = picture_structure != PICT_FRAME;
- if(field_pic){
- h <<= 1;
+ const int field_pic = h->picture_structure != PICT_FRAME;
+ if (field_pic) {
+ height <<= 1;
y <<= 1;
}
- h = FFMIN(h, avctx->height - y);
+ height = FFMIN(height, avctx->height - y);
- if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
+ if (field_pic && h->first_field && !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD))
+ return;
if (avctx->draw_horiz_band) {
AVFrame *src;
int offset[AV_NUM_DATA_POINTERS];
int i;
- if(cur->f.pict_type == AV_PICTURE_TYPE_B || low_delay ||
+ if (cur->f.pict_type == AV_PICTURE_TYPE_B || h->low_delay ||
(avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
src = &cur->f;
else if (last)
@@ -172,27 +174,19 @@ static void draw_horiz_band(AVCodecContext *avctx, Picture *cur,
else
return;
- offset[0]= y * src->linesize[0];
- offset[1]=
- offset[2]= (y >> vshift) * src->linesize[1];
+ offset[0] = y * src->linesize[0];
+ offset[1] =
+ offset[2] = (y >> vshift) * src->linesize[1];
for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
offset[i] = 0;
emms_c();
avctx->draw_horiz_band(avctx, src, offset,
- y, picture_structure, h);
+ y, h->picture_structure, height);
}
}
-void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
-{
- draw_horiz_band(h->avctx, &h->cur_pic,
- h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL,
- y, height, h->picture_structure, h->first_field,
- h->low_delay);
-}
-
static void free_frame_buffer(H264Context *h, Picture *pic)
{
pic->period_since_free = 0;