Revision 290fabc6

View differences:

libavcodec/dsputil.h
65 65
void ff_h264_idct_add8_c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
66 66

  
67 67
void ff_h264_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qmul);
68
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp);
68
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp);
69 69
void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc);
70 70

  
71 71
void ff_vector_fmul_window_c(float *dst, const float *src0, const float *src1,
libavcodec/h264.c
1215 1215
                        }
1216 1216
                    }
1217 1217
                }else
1218
                    ff_svq3_luma_dc_dequant_idct_c(h->mb, s->qscale);
1218
                    ff_svq3_luma_dc_dequant_idct_c(h->mb, h->mb_luma_dc, s->qscale);
1219 1219
            }
1220 1220
            if(h->deblocking_filter)
1221 1221
                xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0, simple);
libavcodec/svq3.c
125 125
    61694, 68745, 77615, 89113,100253,109366,126635,141533
126 126
};
127 127

  
128

  
129
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp)
130
{
128
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp){
131 129
    const int qmul = svq3_dequant_coeff[qp];
132 130
#define stride 16
133 131
    int i;
134 132
    int temp[16];
135
    static const int x_offset[4] = {0, 1*stride, 4* stride,  5*stride};
136
    static const int y_offset[4] = {0, 2*stride, 8* stride, 10*stride};
133
    static const uint8_t x_offset[4]={0, 1*stride, 4*stride, 5*stride};
137 134

  
138
    for (i = 0; i < 4; i++){
139
        const int offset = y_offset[i];
140
        const int z0 = 13*(block[offset+stride*0] +    block[offset+stride*4]);
141
        const int z1 = 13*(block[offset+stride*0] -    block[offset+stride*4]);
142
        const int z2 =  7* block[offset+stride*1] - 17*block[offset+stride*5];
143
        const int z3 = 17* block[offset+stride*1] +  7*block[offset+stride*5];
135
    for(i=0; i<4; i++){
136
        const int z0 = 13*(input[4*i+0] +    input[4*i+2]);
137
        const int z1 = 13*(input[4*i+0] -    input[4*i+2]);
138
        const int z2 =  7* input[4*i+1] - 17*input[4*i+3];
139
        const int z3 = 17* input[4*i+1] +  7*input[4*i+3];
144 140

  
145 141
        temp[4*i+0] = z0+z3;
146 142
        temp[4*i+1] = z1+z2;
......
148 144
        temp[4*i+3] = z0-z3;
149 145
    }
150 146

  
151
    for (i = 0; i < 4; i++){
152
        const int offset = x_offset[i];
153
        const int z0 = 13*(temp[4*0+i] +    temp[4*2+i]);
154
        const int z1 = 13*(temp[4*0+i] -    temp[4*2+i]);
155
        const int z2 =  7* temp[4*1+i] - 17*temp[4*3+i];
156
        const int z3 = 17* temp[4*1+i] +  7*temp[4*3+i];
157

  
158
        block[stride*0 +offset] = ((z0 + z3)*qmul + 0x80000) >> 20;
159
        block[stride*2 +offset] = ((z1 + z2)*qmul + 0x80000) >> 20;
160
        block[stride*8 +offset] = ((z1 - z2)*qmul + 0x80000) >> 20;
161
        block[stride*10+offset] = ((z0 - z3)*qmul + 0x80000) >> 20;
147
    for(i=0; i<4; i++){
148
        const int offset= x_offset[i];
149
        const int z0= 13*(temp[4*0+i] +    temp[4*2+i]);
150
        const int z1= 13*(temp[4*0+i] -    temp[4*2+i]);
151
        const int z2=  7* temp[4*1+i] - 17*temp[4*3+i];
152
        const int z3= 17* temp[4*1+i] +  7*temp[4*3+i];
153

  
154
        output[stride* 0+offset] = ((z0 + z3)*qmul + 0x80000) >> 20;
155
        output[stride* 2+offset] = ((z1 + z2)*qmul + 0x80000) >> 20;
156
        output[stride* 8+offset] = ((z1 - z2)*qmul + 0x80000) >> 20;
157
        output[stride*10+offset] = ((z0 - z3)*qmul + 0x80000) >> 20;
162 158
    }
163 159
}
164 160
#undef stride
......
648 644
        }
649 645
    }
650 646
    if (IS_INTRA16x16(mb_type)) {
651
        if (svq3_decode_block(&s->gb, h->mb, 0, 0)){
647
        AV_ZERO128(h->mb_luma_dc+0);
648
        AV_ZERO128(h->mb_luma_dc+8);
649
        if (svq3_decode_block(&s->gb, h->mb_luma_dc, 0, 1)){
652 650
            av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding intra luma dc\n");
653 651
            return -1;
654 652
        }

Also available in: Unified diff