With the exception of mpeg4_decode_studio_mb(), all decode_mb functions implicitly presumed that the block provided as argument coincides with MpegEncContext.block (they zeroed the latter and then used the former to decode the block); mpeg4_decode_studio_mb() meanwhile did not use the provided block at all (it uses blocks of int32_t). So remove said parameter.
Showing the changes to libavcodec (7 of 7 files). Show all
Unified · Split
| @@ -256,7 +256,7 @@ static int decode_slice(H263DecContext *const h) · 255 unmodified lines | ||
| 256 | 256 | get_bits_count(&h->c.gb), show_bits(&h->c.gb, 24)); |
| 257 | 257 | |
| 258 | 258 | ff_tlog(NULL, "Decoding MB at %dx%d\n", h->c.mb_x, h->c.mb_y); |
| 259 | − ret = h->decode_mb(h, h->c.block); | |
| 259 | + ret = h->decode_mb(h); | |
| 260 | 260 | |
| 261 | 261 | if (h->c.h263_pred || h->c.h263_aic) { |
| 262 | 262 | int mb_xy = h->c.mb_y * h->c.mb_stride + h->c.mb_x; |
| @@ -46,7 +46,7 @@ extern VLCElem ff_h263_mv_vlc[]; · 45 unmodified lines | ||
| 46 | 46 | typedef struct H263DecContext { |
| 47 | 47 | MPVContext c; |
| 48 | 48 | |
| 49 | − int (*decode_mb)(struct H263DecContext *h, int16_t block[6][64]); | |
| 49 | + int (*decode_mb)(struct H263DecContext *h); | |
| 50 | 50 | } H263DecContext; |
| 51 | 51 | |
| 52 | 52 | int ff_h263_decode_motion(H263DecContext *const h, int pred, int f_code); |
| @@ -64,8 +64,7 @@ int ff_h263_decode_mba(H263DecContext *const h); · 11 unmodified lines | ||
| 64 | 64 | void ff_h263_show_pict_info(H263DecContext *const h, int h263_plus); |
| 65 | 65 | |
| 66 | 66 | int ff_intel_h263_decode_picture_header(H263DecContext *const h); |
| 67 | −int ff_h263_decode_mb(H263DecContext *const h, | |
| 68 | − int16_t block[6][64]); | |
| 67 | +int ff_h263_decode_mb(H263DecContext *const h); | |
| 69 | 68 | |
| 70 | 69 | int ff_h263_resync(H263DecContext *const h); |
| 71 | 70 | |
| @@ -776,7 +776,7 @@ static int set_direct_mv(MpegEncContext *s) · 775 unmodified lines | ||
| 776 | 776 | } |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | −int ff_h263_decode_mb(H263DecContext *const h, int16_t block[6][64]) | |
| 779 | +int ff_h263_decode_mb(H263DecContext *const h) | |
| 780 | 780 | { |
| 781 | 781 | int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; |
| 782 | 782 | int16_t *mot_val; |
| @@ -947,7 +947,7 @@ int ff_h263_decode_mb(H263DecContext *const h, int16_t block[6][64]) · 164 unmodified lines | ||
| 947 | 947 | //FIXME UMV |
| 948 | 948 | |
| 949 | 949 | if (HAS_FORWARD_MV(mb_type)) { |
| 950 | − int16_t *mot_val= ff_h263_pred_motion(&h->c, 0, 0, &pred_x, &pred_y); | |
| 950 | + int16_t *mot_val = ff_h263_pred_motion(&h->c, 0, 0, &pred_x, &pred_y); | |
| 951 | 951 | h->c.mv_dir = MV_DIR_FORWARD; |
| 952 | 952 | |
| 953 | 953 | if (h->c.umvplus) |
| @@ -974,7 +974,7 @@ int ff_h263_decode_mb(H263DecContext *const h, int16_t block[6][64]) · 20 unmodified lines | ||
| 974 | 974 | } |
| 975 | 975 | |
| 976 | 976 | if (HAS_BACKWARD_MV(mb_type)) { |
| 977 | − int16_t *mot_val= ff_h263_pred_motion(&h->c, 0, 1, &pred_x, &pred_y); | |
| 977 | + int16_t *mot_val = ff_h263_pred_motion(&h->c, 0, 1, &pred_x, &pred_y); | |
| 978 | 978 | h->c.mv_dir |= MV_DIR_BACKWARD; |
| 979 | 979 | |
| 980 | 980 | if (h->c.umvplus) |
| @@ -1051,7 +1051,7 @@ intra: · 70 unmodified lines | ||
| 1051 | 1051 | |
| 1052 | 1052 | /* decode each block */ |
| 1053 | 1053 | for (i = 0; i < 6; i++) { |
| 1054 | − if (h263_decode_block(h, block[i], i, cbp&32) < 0) | |
| 1054 | + if (h263_decode_block(h, h->c.block[i], i, cbp&32) < 0) | |
| 1055 | 1055 | return -1; |
| 1056 | 1056 | cbp+=cbp; |
| 1057 | 1057 | } |
| @@ -1651,7 +1651,7 @@ not_coded: · 1650 unmodified lines | ||
| 1651 | 1651 | * decode partition C of one MB. |
| 1652 | 1652 | * @return <0 if an error occurred |
| 1653 | 1653 | */ |
| 1654 | −static int mpeg4_decode_partitioned_mb(H263DecContext *const h, int16_t block[6][64]) | |
| 1654 | +static int mpeg4_decode_partitioned_mb(H263DecContext *const h) | |
| 1655 | 1655 | { |
| 1656 | 1656 | Mpeg4DecContext *const ctx = h263_to_mpeg4(h); |
| 1657 | 1657 | const int xy = h->c.mb_x + h->c.mb_y * h->c.mb_stride; |
| @@ -1711,7 +1711,7 @@ static int mpeg4_decode_partitioned_mb(H263DecContext *const h, int16_t block[6] · 53 unmodified lines | ||
| 1711 | 1711 | h->c.bdsp.clear_blocks(h->c.block[0]); |
| 1712 | 1712 | /* decode each block */ |
| 1713 | 1713 | for (i = 0; i < 6; i++) { |
| 1714 | − if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, h->c.mb_intra, | |
| 1714 | + if (mpeg4_decode_block(ctx, h->c.block[i], i, cbp & 32, h->c.mb_intra, | |
| 1715 | 1715 | use_intra_dc_vlc, ctx->rvlc) < 0) { |
| 1716 | 1716 | av_log(h->c.avctx, AV_LOG_ERROR, |
| 1717 | 1717 | "texture corrupted at %d %d %d\n", |
| @@ -1738,7 +1738,7 @@ static int mpeg4_decode_partitioned_mb(H263DecContext *const h, int16_t block[6] · 20 unmodified lines | ||
| 1738 | 1738 | } |
| 1739 | 1739 | } |
| 1740 | 1740 | |
| 1741 | −static int mpeg4_decode_mb(H263DecContext *const h, int16_t block[6][64]) | |
| 1741 | +static int mpeg4_decode_mb(H263DecContext *const h) | |
| 1742 | 1742 | { |
| 1743 | 1743 | Mpeg4DecContext *const ctx = h263_to_mpeg4(h); |
| 1744 | 1744 | int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; |
| @@ -2076,7 +2076,7 @@ intra: · 331 unmodified lines | ||
| 2076 | 2076 | h->c.bdsp.clear_blocks(h->c.block[0]); |
| 2077 | 2077 | /* decode each block */ |
| 2078 | 2078 | for (i = 0; i < 6; i++) { |
| 2079 | − if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, | |
| 2079 | + if (mpeg4_decode_block(ctx, h->c.block[i], i, cbp & 32, | |
| 2080 | 2080 | 1, use_intra_dc_vlc, 0) < 0) |
| 2081 | 2081 | return AVERROR_INVALIDDATA; |
| 2082 | 2082 | cbp += cbp; |
| @@ -2086,7 +2086,7 @@ intra: · 3 unmodified lines | ||
| 2086 | 2086 | |
| 2087 | 2087 | /* decode each block */ |
| 2088 | 2088 | for (i = 0; i < 6; i++) { |
| 2089 | − if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, 0, 0, 0) < 0) | |
| 2089 | + if (mpeg4_decode_block(ctx, h->c.block[i], i, cbp & 32, 0, 0, 0) < 0) | |
| 2090 | 2090 | return AVERROR_INVALIDDATA; |
| 2091 | 2091 | cbp += cbp; |
| 2092 | 2092 | } |
| @@ -2353,7 +2353,7 @@ static int mpeg4_decode_dpcm_macroblock(Mpeg4DecContext *const ctx, · 260 unmodified lines | ||
| 2353 | 2353 | return 0; |
| 2354 | 2354 | } |
| 2355 | 2355 | |
| 2356 | −static int mpeg4_decode_studio_mb(H263DecContext *const h, int16_t block_[12][64]) | |
| 2356 | +static int mpeg4_decode_studio_mb(H263DecContext *const h) | |
| 2357 | 2357 | { |
| 2358 | 2358 | Mpeg4DecContext *const ctx = h263_to_mpeg4(h); |
| 2359 | 2359 | int i; |
| @@ -106,7 +106,7 @@ static int msmpeg4v2_decode_motion(H263DecContext *const h, int pred, int f_code · 105 unmodified lines | ||
| 106 | 106 | return val; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | −static int msmpeg4v12_decode_mb(H263DecContext *const h, int16_t block[6][64]) | |
| 109 | +static int msmpeg4v12_decode_mb(H263DecContext *const h) | |
| 110 | 110 | { |
| 111 | 111 | MSMP4DecContext *const ms = mpv_to_msmpeg4(h); |
| 112 | 112 | int cbp, code, i; |
| @@ -203,7 +203,7 @@ static int msmpeg4v12_decode_mb(H263DecContext *const h, int16_t block[6][64]) · 90 unmodified lines | ||
| 203 | 203 | |
| 204 | 204 | h->c.bdsp.clear_blocks(h->c.block[0]); |
| 205 | 205 | for (i = 0; i < 6; i++) { |
| 206 | − if (ff_msmpeg4_decode_block(ms, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) | |
| 206 | + if (ff_msmpeg4_decode_block(ms, h->c.block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) | |
| 207 | 207 | { |
| 208 | 208 | av_log(h->c.avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", |
| 209 | 209 | h->c.mb_x, h->c.mb_y, i); |
| @@ -213,7 +213,7 @@ static int msmpeg4v12_decode_mb(H263DecContext *const h, int16_t block[6][64]) · 3 unmodified lines | ||
| 213 | 213 | return 0; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | −static int msmpeg4v34_decode_mb(H263DecContext *const h, int16_t block[6][64]) | |
| 216 | +static int msmpeg4v34_decode_mb(H263DecContext *const h) | |
| 217 | 217 | { |
| 218 | 218 | MSMP4DecContext *const ms = mpv_to_msmpeg4(h); |
| 219 | 219 | int cbp, code, i; |
| @@ -294,7 +294,7 @@ static int msmpeg4v34_decode_mb(H263DecContext *const h, int16_t block[6][64]) · 74 unmodified lines | ||
| 294 | 294 | |
| 295 | 295 | h->c.bdsp.clear_blocks(h->c.block[0]); |
| 296 | 296 | for (i = 0; i < 6; i++) { |
| 297 | − if (ff_msmpeg4_decode_block(ms, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) | |
| 297 | + if (ff_msmpeg4_decode_block(ms, h->c.block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) | |
| 298 | 298 | { |
| 299 | 299 | av_log(h->c.avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", |
| 300 | 300 | h->c.mb_x, h->c.mb_y, i); |
| @@ -488,7 +488,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, · 487 unmodified lines | ||
| 488 | 488 | |
| 489 | 489 | h->c.mv_dir = MV_DIR_FORWARD; |
| 490 | 490 | h->c.mv_type = MV_TYPE_16X16; |
| 491 | − ret = ff_h263_decode_mb(h, h->c.block); | |
| 491 | + ret = ff_h263_decode_mb(h); | |
| 492 | 492 | |
| 493 | 493 | // Repeat the slice end check from ff_h263_decode_mb with our active |
| 494 | 494 | // bitstream size |
| @@ -442,7 +442,7 @@ static inline int wmv2_decode_inter_block(WMV2DecContext *w, int16_t *block, · 441 unmodified lines | ||
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | −static int wmv2_decode_mb(H263DecContext *const h, int16_t block[6][64]) | |
| 445 | +static int wmv2_decode_mb(H263DecContext *const h) | |
| 446 | 446 | { |
| 447 | 447 | /* The following is only allowed because this decoder |
| 448 | 448 | * does not use slice threading. */ |
| @@ -522,7 +522,7 @@ static int wmv2_decode_mb(H263DecContext *const h, int16_t block[6][64]) · 73 unmodified lines | ||
| 522 | 522 | h->c.mv[0][0][1] = my; |
| 523 | 523 | |
| 524 | 524 | for (i = 0; i < 6; i++) { |
| 525 | − if ((ret = wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1)) < 0) { | |
| 525 | + if ((ret = wmv2_decode_inter_block(w, h->c.block[i], i, (cbp >> (5 - i)) & 1)) < 0) { | |
| 526 | 526 | av_log(h->c.avctx, AV_LOG_ERROR, |
| 527 | 527 | "\nerror while decoding inter block: %d x %d (%d)\n", |
| 528 | 528 | h->c.mb_x, h->c.mb_y, i); |
| @@ -549,7 +549,7 @@ static int wmv2_decode_mb(H263DecContext *const h, int16_t block[6][64]) · 20 unmodified lines | ||
| 549 | 549 | |
| 550 | 550 | h->c.bdsp.clear_blocks(h->c.block[0]); |
| 551 | 551 | for (i = 0; i < 6; i++) { |
| 552 | − ret = ff_msmpeg4_decode_block(ms, block[i], i, (cbp >> (5 - i)) & 1, NULL); | |
| 552 | + ret = ff_msmpeg4_decode_block(ms, h->c.block[i], i, (cbp >> (5 - i)) & 1, NULL); | |
| 553 | 553 | if (ret < 0) { |
| 554 | 554 | av_log(h->c.avctx, AV_LOG_ERROR, |
| 555 | 555 | "\nerror while decoding intra block: %d x %d (%d)\n", |