Revision 6b3661b2

View differences:

libavcodec/h264_loopfilter.c
136 136

  
137 137
static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {
138 138
    int i;
139
    int index_a = qp + h->slice_alpha_c0_offset;
140
    int alpha = (alpha_table+52)[index_a];
141
    int beta  = (beta_table+52)[qp + h->slice_beta_offset];
139 142
    for( i = 0; i < 8; i++, pix += stride) {
140
        int index_a;
141
        int alpha;
142
        int beta;
143 143
        const int bS_index = (i >> 1) * bsi;
144 144

  
145 145
        if( bS[bS_index] == 0 ) {
146 146
            continue;
147 147
        }
148 148

  
149
        index_a = qp + h->slice_alpha_c0_offset;
150
        alpha = (alpha_table+52)[index_a];
151
        beta  = (beta_table+52)[qp + h->slice_beta_offset];
152

  
153 149
        if( bS[bS_index] < 4 ) {
154 150
            const int tc0 = (tc0_table+52)[index_a][bS[bS_index]];
155 151
            const int p0 = pix[-1];
......
166 162
                int i_delta;
167 163

  
168 164
                if( FFABS( p2 - p0 ) < beta ) {
165
                    if(tc0)
169 166
                    pix[-2] = p1 + av_clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0, tc0 );
170 167
                    tc++;
171 168
                }
172 169
                if( FFABS( q2 - q0 ) < beta ) {
170
                    if(tc0)
173 171
                    pix[1] = q1 + av_clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0, tc0 );
174 172
                    tc++;
175 173
                }
......
227 225
}
228 226
static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {
229 227
    int i;
228
    int index_a = qp + h->slice_alpha_c0_offset;
229
    int alpha = (alpha_table+52)[index_a];
230
    int beta  = (beta_table+52)[qp + h->slice_beta_offset];
230 231
    for( i = 0; i < 4; i++, pix += stride) {
231
        int index_a;
232
        int alpha;
233
        int beta;
234 232
        const int bS_index = i*bsi;
235 233

  
236 234
        if( bS[bS_index] == 0 ) {
237 235
            continue;
238 236
        }
239 237

  
240
        index_a = qp + h->slice_alpha_c0_offset;
241
        alpha = (alpha_table+52)[index_a];
242
        beta  = (beta_table+52)[qp + h->slice_beta_offset];
243

  
244 238
        if( bS[bS_index] < 4 ) {
245 239
            const int tc = (tc0_table+52)[index_a][bS[bS_index]] + 1;
246 240
            const int p0 = pix[-1];

Also available in: Unified diff