| @@ -480,24 +480,18 @@ static void x8_ac_compensation(IntraX8Context *const w, const int direction, · 479 unmodified lines |
| 480 | | 480 | |
| 481 | t = T(1084); // g | 481 | t = T(1084); // g |
| 482 | B(1, 1) += t; | 482 | B(1, 1) += t; |
| 483 | | | |
| 484 | w->block_last_index[0] = FFMAX(w->block_last_index[0], 7 * 8); | | |
| 485 | break; | 483 | break; |
| 486 | case 1: | 484 | case 1: |
| 487 | B(0, 1) -= T(6269); | 485 | B(0, 1) -= T(6269); |
| 488 | B(0, 3) -= T(708); | 486 | B(0, 3) -= T(708); |
| 489 | B(0, 5) -= T(172); | 487 | B(0, 5) -= T(172); |
| 490 | B(0, 7) -= T(73); | 488 | B(0, 7) -= T(73); |
| 491 | | | |
| 492 | w->block_last_index[0] = FFMAX(w->block_last_index[0], 7 * 8); | | |
| 493 | break; | 489 | break; |
| 494 | case 2: | 490 | case 2: |
| 495 | B(1, 0) -= T(6269); | 491 | B(1, 0) -= T(6269); |
| 496 | B(3, 0) -= T(708); | 492 | B(3, 0) -= T(708); |
| 497 | B(5, 0) -= T(172); | 493 | B(5, 0) -= T(172); |
| 498 | B(7, 0) -= T(73); | 494 | B(7, 0) -= T(73); |
| 499 | | | |
| 500 | w->block_last_index[0] = FFMAX(w->block_last_index[0], 7); | | |
| 501 | break; | 495 | break; |
| 502 | } | 496 | } |
| 503 | #undef B | 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 | w->block[0][scantable[pos]] = level; | 594 | w->block[0][scantable[pos]] = level; |
| 601 | } while (!final); | 595 | } while (!final); |
| 602 | | | |
| 603 | w->block_last_index[0] = pos; | | |
| 604 | } else { // DC only | 596 | } else { // DC only |
| 605 | w->block_last_index[0] = 0; | | |
| 606 | if (w->flat_dc && ((unsigned) (dc_level + 1)) < 3) { // [-1; 1] | 597 | if (w->flat_dc && ((unsigned) (dc_level + 1)) < 3) { // [-1; 1] |
| 607 | int32_t divide_quant = !chroma ? w->divide_quant_dc_luma | 598 | int32_t divide_quant = !chroma ? w->divide_quant_dc_luma |
| 608 | : w->divide_quant_dc_chroma; | 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 | * -> 01'10' 10'10' 00'00' 00'01' 01'11' 11'00 => 0x6A017C */ | 624 | * -> 01'10' 10'10' 00'00' 00'01' 01'11' 11'00 => 0x6A017C */ |
| 634 | direction = (0x6A017C >> (w->orient * 2)) & 3; | 625 | direction = (0x6A017C >> (w->orient * 2)) & 3; |
| 635 | if (direction != 3) { | 626 | if (direction != 3) { |
| 636 | // modify block_last[] | | |
| 637 | x8_ac_compensation(w, direction, w->block[0][0]); | 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 | av_cold int ff_intrax8_common_init(AVCodecContext *avctx, | 679 | av_cold int ff_intrax8_common_init(AVCodecContext *avctx, |
| 690 | IntraX8Context *w, | 680 | IntraX8Context *w, |
| 691 | int16_t (*block)[64], | 681 | int16_t (*block)[64], |
| 692 | int block_last_index[12], | | |
| 693 | int mb_width, int mb_height) | 682 | int mb_width, int mb_height) |
| 694 | { | 683 | { |
| 695 | static AVOnce init_static_once = AV_ONCE_INIT; | 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 | w->mb_width = mb_width; | 687 | w->mb_width = mb_width; |
| 699 | w->mb_height = mb_height; | 688 | w->mb_height = mb_height; |
| 700 | w->block = block; | 689 | w->block = block; |
| 701 | w->block_last_index = block_last_index; | | |
| 702 | | 690 | |
| 703 | // two rows, 2 blocks per cannon mb | 691 | // two rows, 2 blocks per cannon mb |
| 704 | w->prediction_table = av_mallocz(w->mb_width * 2 * 2); | 692 | w->prediction_table = av_mallocz(w->mb_width * 2 * 2); |