These values are only used by the mpegvideo unquantize functions, yet these are not active when intrax is in use. Furthermore, given that ff_intrax8_decode_picture() decodes multiple macroblocks in a given call, it makes no sense to return any value (that was in practice the maximum of the indices of all the macroblocks decoded).
Showing the changes to libavcodec (4 of 4 files). Show all
Unified · Split
| @@ -480,24 +480,18 @@ static void x8_ac_compensation(IntraX8Context *const w, const int direction, · 479 unmodified lines | ||
| 480 | 480 | |
| 481 | 481 | t = T(1084); // g |
| 482 | 482 | B(1, 1) += t; |
| 483 | − | |
| 484 | − w->block_last_index[0] = FFMAX(w->block_last_index[0], 7 * 8); | |
| 485 | 483 | break; |
| 486 | 484 | case 1: |
| 487 | 485 | B(0, 1) -= T(6269); |
| 488 | 486 | B(0, 3) -= T(708); |
| 489 | 487 | B(0, 5) -= T(172); |
| 490 | 488 | B(0, 7) -= T(73); |
| 491 | − | |
| 492 | − w->block_last_index[0] = FFMAX(w->block_last_index[0], 7 * 8); | |
| 493 | 489 | break; |
| 494 | 490 | case 2: |
| 495 | 491 | B(1, 0) -= T(6269); |
| 496 | 492 | B(3, 0) -= T(708); |
| 497 | 493 | B(5, 0) -= T(172); |
| 498 | 494 | B(7, 0) -= T(73); |
| 499 | − | |
| 500 | − w->block_last_index[0] = FFMAX(w->block_last_index[0], 7); | |
| 501 | 495 | break; |
| 502 | 496 | } |
| 503 | 497 | #undef B |
| @@ -599,10 +593,7 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma) · 95 unmodified lines | ||
| 599 | 593 | |
| 600 | 594 | w->block[0][scantable[pos]] = level; |
| 601 | 595 | } while (!final); |
| 602 | − | |
| 603 | − w->block_last_index[0] = pos; | |
| 604 | 596 | } else { // DC only |
| 605 | − w->block_last_index[0] = 0; | |
| 606 | 597 | if (w->flat_dc && ((unsigned) (dc_level + 1)) < 3) { // [-1; 1] |
| 607 | 598 | int32_t divide_quant = !chroma ? w->divide_quant_dc_luma |
| 608 | 599 | : w->divide_quant_dc_chroma; |
| @@ -633,7 +624,6 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma) · 24 unmodified lines | ||
| 633 | 624 | * -> 01'10' 10'10' 00'00' 00'01' 01'11' 11'00 => 0x6A017C */ |
| 634 | 625 | direction = (0x6A017C >> (w->orient * 2)) & 3; |
| 635 | 626 | if (direction != 3) { |
| 636 | − // modify block_last[] | |
| 637 | 627 | x8_ac_compensation(w, direction, w->block[0][0]); |
| 638 | 628 | } |
| 639 | 629 | } |
| @@ -689,7 +679,6 @@ static void x8_init_block_index(IntraX8Context *w, AVFrame *frame) · 49 unmodified lines | ||
| 689 | 679 | av_cold int ff_intrax8_common_init(AVCodecContext *avctx, |
| 690 | 680 | IntraX8Context *w, |
| 691 | 681 | int16_t (*block)[64], |
| 692 | − int block_last_index[12], | |
| 693 | 682 | int mb_width, int mb_height) |
| 694 | 683 | { |
| 695 | 684 | static AVOnce init_static_once = AV_ONCE_INIT; |
| @@ -698,7 +687,6 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx, · 2 unmodified lines | ||
| 698 | 687 | w->mb_width = mb_width; |
| 699 | 688 | w->mb_height = mb_height; |
| 700 | 689 | w->block = block; |
| 701 | − w->block_last_index = block_last_index; | |
| 702 | 690 | |
| 703 | 691 | // two rows, 2 blocks per cannon mb |
| 704 | 692 | w->prediction_table = av_mallocz(w->mb_width * 2 * 2); |
| @@ -38,7 +38,6 @@ typedef struct IntraX8Context { · 37 unmodified lines | ||
| 38 | 38 | WMV2DSPContext wdsp; |
| 39 | 39 | uint8_t idct_permutation[64]; |
| 40 | 40 | AVCodecContext *avctx; |
| 41 | − int *block_last_index; ///< last nonzero coefficient in block | |
| 42 | 41 | int16_t (*block)[64]; |
| 43 | 42 | |
| 44 | 43 | // set by the caller codec |
| @@ -77,7 +76,6 @@ typedef struct IntraX8Context { · 32 unmodified lines | ||
| 77 | 76 | * @param avctx pointer to AVCodecContext |
| 78 | 77 | * @param w pointer to IntraX8Context |
| 79 | 78 | * @param block pointer to block array |
| 80 | − * @param block_last_index pointer to index array | |
| 81 | 79 | * @param mb_width macroblock width |
| 82 | 80 | * @param mb_height macroblock height |
| 83 | 81 | * @return 0 on success, a negative AVERROR value on error |
| @@ -85,7 +83,6 @@ typedef struct IntraX8Context { · 1 unmodified line | ||
| 85 | 83 | int ff_intrax8_common_init(AVCodecContext *avctx, |
| 86 | 84 | IntraX8Context *w, |
| 87 | 85 | int16_t (*block)[64], |
| 88 | − int block_last_index[12], | |
| 89 | 86 | int mb_width, int mb_height); |
| 90 | 87 | |
| 91 | 88 | /** |
| @@ -422,8 +422,7 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v) · 421 unmodified lines | ||
| 422 | 422 | return AVERROR(ENOMEM); |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | − ret = ff_intrax8_common_init(s->avctx, &v->x8, | |
| 426 | − s->block, s->block_last_index, | |
| 425 | + ret = ff_intrax8_common_init(s->avctx, &v->x8, s->block, | |
| 427 | 426 | s->mb_width, s->mb_height); |
| 428 | 427 | if (ret < 0) |
| 429 | 428 | return ret; |
| @@ -575,8 +575,7 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx) · 574 unmodified lines | ||
| 575 | 575 | |
| 576 | 576 | decode_ext_header(w); |
| 577 | 577 | |
| 578 | − return ff_intrax8_common_init(avctx, &w->x8, | |
| 579 | − w->s.block, w->s.block_last_index, | |
| 578 | + return ff_intrax8_common_init(avctx, &w->x8, w->s.block, | |
| 580 | 579 | w->s.mb_width, w->s.mb_height); |
| 581 | 580 | } |
| 582 | 581 | |