diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-02-17 02:14:02 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-02-17 02:14:02 +0000 |
commit | 69cc31832f47f00be8cac9c2c97a04ebb4844dec (patch) | |
tree | 6a6c7536323b69f913c353aec244a7c3b2a38bb0 /libavcodec | |
parent | 59f733d1b1814ff7e2ead43415bb4b89cbed4b0f (diff) | |
download | ffmpeg-69cc31832f47f00be8cac9c2c97a04ebb4844dec.tar.gz |
Move check for and call of predict_field_decoding_flag() from the mb code to
the row code. This function would only be needed on a MB basis for MBAFF+FMO
Originally committed as revision 21860 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264.c | 4 | ||||
-rw-r--r-- | libavcodec/h264.h | 2 | ||||
-rw-r--r-- | libavcodec/h264_cabac.c | 2 | ||||
-rw-r--r-- | libavcodec/h264_cavlc.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 604c29e273..62ee92090a 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2257,6 +2257,8 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){ ++s->mb_y; if(FIELD_OR_MBAFF_PICTURE) { ++s->mb_y; + if(FRAME_MBAFF && s->mb_y < s->mb_height) + predict_field_decoding_flag(h); } } @@ -2295,6 +2297,8 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){ ++s->mb_y; if(FIELD_OR_MBAFF_PICTURE) { ++s->mb_y; + if(FRAME_MBAFF && s->mb_y < s->mb_height) + predict_field_decoding_flag(h); } if(s->mb_y >= s->mb_height){ tprintf(s->avctx, "slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits); diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 2eec36309e..13a7b9b90f 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1453,7 +1453,7 @@ static inline int get_dct8x8_allowed(H264Context *h){ static void predict_field_decoding_flag(H264Context *h){ MpegEncContext * const s = &h->s; - const int mb_xy= h->mb_xy; + const int mb_xy= s->mb_x + s->mb_y*s->mb_stride; int mb_type = (h->slice_table[mb_xy-1] == h->slice_num) ? s->current_picture.mb_type[mb_xy-1] : (h->slice_table[mb_xy-s->mb_stride] == h->slice_num) diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 45a96506af..1479697814 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1196,8 +1196,6 @@ int ff_h264_decode_mb_cabac(H264Context *h) { if( h->slice_type_nos != FF_I_TYPE ) { int skip; /* a skipped mb needs the aff flag from the following mb */ - if( FRAME_MBAFF && s->mb_x==0 && (s->mb_y&1)==0 ) - predict_field_decoding_flag(h); if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped ) skip = h->next_mb_skipped; else diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index ee408050e4..d83a306a5e 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -547,8 +547,6 @@ int ff_h264_decode_mb_cavlc(H264Context *h){ if(FRAME_MBAFF && (s->mb_y&1) == 0){ if(s->mb_skip_run==0) h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&s->gb); - else - predict_field_decoding_flag(h); } decode_mb_skip(h); return 0; |