Unified · Split
| @@ -51,11 +51,11 @@ static const int mb_type_b_map[4] = { · 50 unmodified lines | |||
| 51 | MB_TYPE_L0 | MB_TYPE_16x16, | 51 | MB_TYPE_L0 | MB_TYPE_16x16, |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | static inline int check_marker(GetBitContext *s, const char *msg) | 54 | static inline int check_marker(AVCodecContext *avctx, GetBitContext *s, const char *msg) |
| 55 | { | 55 | { |
| 56 | int bit = get_bits1(s); | 56 | int bit = get_bits1(s); |
| 57 | if (!bit) | 57 | if (!bit) |
| 58 | av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg); | 58 | av_log(avctx, AV_LOG_INFO, "Marker bit missing %s\n", msg); |
| 59 | 59 | ||
| 60 | return bit; | 60 | return bit; |
| 61 | } | 61 | } |
| @@ -446,9 +446,9 @@ int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx) · 384 unmodified lines | |||
| 446 | while (get_bits1(&s->gb) != 0) | 446 | while (get_bits1(&s->gb) != 0) |
| 447 | time_incr++; | 447 | time_incr++; |
| 448 | 448 | ||
| 449 | check_marker(&s->gb, "before time_increment in video packed header"); | 449 | check_marker(s->avctx, &s->gb, "before time_increment in video packed header"); |
| 450 | skip_bits(&s->gb, ctx->time_increment_bits); /* time_increment */ | 450 | skip_bits(&s->gb, ctx->time_increment_bits); /* time_increment */ |
| 451 | check_marker(&s->gb, "before vop_coding_type in video packed header"); | 451 | check_marker(s->avctx, &s->gb, "before vop_coding_type in video packed header"); |
| 452 | 452 | ||
| 453 | skip_bits(&s->gb, 2); /* vop coding type */ | 453 | skip_bits(&s->gb, 2); /* vop coding type */ |
| 454 | // FIXME not rect stuff here | 454 | // FIXME not rect stuff here |
| @@ -1731,7 +1731,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 1276 unmodified lines | |||
| 1731 | skip_bits(gb, 4); /* video_object_layer_shape_extension */ | 1731 | skip_bits(gb, 4); /* video_object_layer_shape_extension */ |
| 1732 | } | 1732 | } |
| 1733 | 1733 | ||
| 1734 | check_marker(gb, "before time_increment_resolution"); | 1734 | check_marker(s->avctx, gb, "before time_increment_resolution"); |
| 1735 | 1735 | ||
| 1736 | s->avctx->framerate.num = get_bits(gb, 16); | 1736 | s->avctx->framerate.num = get_bits(gb, 16); |
| 1737 | if (!s->avctx->framerate.num) { | 1737 | if (!s->avctx->framerate.num) { |
| @@ -1743,7 +1743,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 5 unmodified lines | |||
| 1743 | if (ctx->time_increment_bits < 1) | 1743 | if (ctx->time_increment_bits < 1) |
| 1744 | ctx->time_increment_bits = 1; | 1744 | ctx->time_increment_bits = 1; |
| 1745 | 1745 | ||
| 1746 | check_marker(gb, "before fixed_vop_rate"); | 1746 | check_marker(s->avctx, gb, "before fixed_vop_rate"); |
| 1747 | 1747 | ||
| 1748 | if (get_bits1(gb) != 0) /* fixed_vop_rate */ | 1748 | if (get_bits1(gb) != 0) /* fixed_vop_rate */ |
| 1749 | s->avctx->framerate.den = get_bits(gb, ctx->time_increment_bits); | 1749 | s->avctx->framerate.den = get_bits(gb, ctx->time_increment_bits); |
| @@ -1909,7 +1909,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 159 unmodified lines | |||
| 1909 | ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* inter4v_blocks */ | 1909 | ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* inter4v_blocks */ |
| 1910 | ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* not coded blocks */ | 1910 | ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* not coded blocks */ |
| 1911 | } | 1911 | } |
| 1912 | if (!check_marker(gb, "in complexity estimation part 1")) { | 1912 | if (!check_marker(s->avctx, gb, "in complexity estimation part 1")) { |
| 1913 | skip_bits_long(gb, pos - get_bits_count(gb)); | 1913 | skip_bits_long(gb, pos - get_bits_count(gb)); |
| 1914 | goto no_cplx_est; | 1914 | goto no_cplx_est; |
| 1915 | } | 1915 | } |
| @@ -1927,7 +1927,7 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 11 unmodified lines | |||
| 1927 | ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* halfpel2 */ | 1927 | ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* halfpel2 */ |
| 1928 | ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* halfpel4 */ | 1928 | ctx->cplx_estimation_trash_p += 8 * get_bits1(gb); /* halfpel4 */ |
| 1929 | } | 1929 | } |
| 1930 | if (!check_marker(gb, "in complexity estimation part 2")) { | 1930 | if (!check_marker(s->avctx, gb, "in complexity estimation part 2")) { |
| 1931 | skip_bits_long(gb, pos - get_bits_count(gb)); | 1931 | skip_bits_long(gb, pos - get_bits_count(gb)); |
| 1932 | goto no_cplx_est; | 1932 | goto no_cplx_est; |
| 1933 | } | 1933 | } |
| @@ -2104,7 +2104,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 170 unmodified lines | |||
| 2104 | while (get_bits1(gb) != 0) | 2104 | while (get_bits1(gb) != 0) |
| 2105 | time_incr++; | 2105 | time_incr++; |
| 2106 | 2106 | ||
| 2107 | check_marker(gb, "before time_increment"); | 2107 | check_marker(s->avctx, gb, "before time_increment"); |
| 2108 | 2108 | ||
| 2109 | if (ctx->time_increment_bits == 0 || | 2109 | if (ctx->time_increment_bits == 0 || |
| 2110 | !(show_bits(gb, ctx->time_increment_bits + 1) & 1)) { | 2110 | !(show_bits(gb, ctx->time_increment_bits + 1) & 1)) { |
| @@ -2166,7 +2166,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) · 55 unmodified lines | |||
| 2166 | } | 2166 | } |
| 2167 | } | 2167 | } |
| 2168 | 2168 | ||
| 2169 | check_marker(gb, "before vop_coded"); | 2169 | check_marker(s->avctx, gb, "before vop_coded"); |
| 2170 | 2170 | ||
| 2171 | /* vop coded */ | 2171 | /* vop coded */ |
| 2172 | if (get_bits1(gb) != 1) { | 2172 | if (get_bits1(gb) != 1) { |