comparison vp3.c @ 2695:5d4a6edbc99c libavcodec

remove duplicate zigzag tables
author michael
date Tue, 17 May 2005 11:36:07 +0000
parents 0d229cf036b9
children fae7fce1a202
comparison
equal deleted inserted replaced
2694:0d229cf036b9 2695:5d4a6edbc99c
887 /* scale AC quantizers, zigzag at the same time in preparation for 887 /* scale AC quantizers, zigzag at the same time in preparation for
888 * the dequantization phase */ 888 * the dequantization phase */
889 for (i = 1; i < 64; i++) { 889 for (i = 1; i < 64; i++) {
890 int k= s->scantable.scantable[i]; 890 int k= s->scantable.scantable[i];
891 j = s->scantable.permutated[i]; 891 j = s->scantable.permutated[i];
892
893 892
894 s->intra_y_dequant[j] = s->coded_intra_y_dequant[k] * ac_scale_factor / 100; 893 s->intra_y_dequant[j] = s->coded_intra_y_dequant[k] * ac_scale_factor / 100;
895 if (s->intra_y_dequant[j] < MIN_DEQUANT_VAL) 894 if (s->intra_y_dequant[j] < MIN_DEQUANT_VAL)
896 s->intra_y_dequant[j] = MIN_DEQUANT_VAL; 895 s->intra_y_dequant[j] = MIN_DEQUANT_VAL;
897 s->intra_y_dequant[j] *= SCALER; 896 s->intra_y_dequant[j] *= SCALER;
2612 init_vlc(&s->ac_vlc_4[i], 5, 32, 2611 init_vlc(&s->ac_vlc_4[i], 5, 32,
2613 &ac_bias_3[i][0][1], 4, 2, 2612 &ac_bias_3[i][0][1], 4, 2,
2614 &ac_bias_3[i][0][0], 4, 2, 0); 2613 &ac_bias_3[i][0][0], 4, 2, 0);
2615 } 2614 }
2616 2615
2617 /* build quantization zigzag table */
2618 for (i = 0; i < 64; i++)
2619 zigzag_index[dezigzag_index[i]] = i;
2620
2621 /* work out the block mapping tables */ 2616 /* work out the block mapping tables */
2622 s->superblock_fragments = av_malloc(s->superblock_count * 16 * sizeof(int)); 2617 s->superblock_fragments = av_malloc(s->superblock_count * 16 * sizeof(int));
2623 s->superblock_macroblocks = av_malloc(s->superblock_count * 4 * sizeof(int)); 2618 s->superblock_macroblocks = av_malloc(s->superblock_count * 4 * sizeof(int));
2624 s->macroblock_fragments = av_malloc(s->macroblock_count * 6 * sizeof(int)); 2619 s->macroblock_fragments = av_malloc(s->macroblock_count * 6 * sizeof(int));
2625 s->macroblock_coding = av_malloc(s->macroblock_count + 1); 2620 s->macroblock_coding = av_malloc(s->macroblock_count + 1);