Revision 0c32e19d libavcodec/h264_loopfilter.c

View differences:

libavcodec/h264_loopfilter.c
100 100
};
101 101

  
102 102
static void av_noinline filter_mb_edgev( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h) {
103
    const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset;
103
    const unsigned int index_a = qp + h->slice_alpha_c0_offset;
104 104
    const int alpha = alpha_table[index_a];
105
    const int beta  = (beta_table+52)[qp + h->slice_beta_offset];
105
    const int beta  = beta_table[qp + h->slice_beta_offset];
106 106
    if (alpha ==0 || beta == 0) return;
107 107

  
108 108
    if( bS[0] < 4 ) {
......
117 117
    }
118 118
}
119 119
static void av_noinline filter_mb_edgecv( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) {
120
    const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset;
120
    const unsigned int index_a = qp + h->slice_alpha_c0_offset;
121 121
    const int alpha = alpha_table[index_a];
122
    const int beta  = (beta_table+52)[qp + h->slice_beta_offset];
122
    const int beta  = beta_table[qp + h->slice_beta_offset];
123 123
    if (alpha ==0 || beta == 0) return;
124 124

  
125 125
    if( bS[0] < 4 ) {
......
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 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];
140
    int alpha = alpha_table[index_a];
141
    int beta  = beta_table[qp + h->slice_beta_offset];
142 142
    for( i = 0; i < 8; i++, pix += stride) {
143 143
        const int bS_index = (i >> 1) * bsi;
144 144

  
......
147 147
        }
148 148

  
149 149
        if( bS[bS_index] < 4 ) {
150
            const int tc0 = (tc0_table+52)[index_a][bS[bS_index]];
150
            const int tc0 = tc0_table[index_a][bS[bS_index]];
151 151
            const int p0 = pix[-1];
152 152
            const int p1 = pix[-2];
153 153
            const int p2 = pix[-3];
......
226 226
static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {
227 227
    int i;
228 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];
229
    int alpha = alpha_table[index_a];
230
    int beta  = beta_table[qp + h->slice_beta_offset];
231 231
    for( i = 0; i < 4; i++, pix += stride) {
232 232
        const int bS_index = i*bsi;
233 233

  
......
236 236
        }
237 237

  
238 238
        if( bS[bS_index] < 4 ) {
239
            const int tc = (tc0_table+52)[index_a][bS[bS_index]] + 1;
239
            const int tc = tc0_table[index_a][bS[bS_index]] + 1;
240 240
            const int p0 = pix[-1];
241 241
            const int p1 = pix[-2];
242 242
            const int q0 = pix[0];
......
270 270
}
271 271

  
272 272
static void av_noinline filter_mb_edgeh( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) {
273
    const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset;
273
    const unsigned int index_a = qp + h->slice_alpha_c0_offset;
274 274
    const int alpha = alpha_table[index_a];
275
    const int beta  = (beta_table+52)[qp + h->slice_beta_offset];
275
    const int beta  = beta_table[qp + h->slice_beta_offset];
276 276
    if (alpha ==0 || beta == 0) return;
277 277

  
278 278
    if( bS[0] < 4 ) {
......
288 288
}
289 289

  
290 290
static void av_noinline filter_mb_edgech( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) {
291
    const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset;
291
    const unsigned int index_a = qp + h->slice_alpha_c0_offset;
292 292
    const int alpha = alpha_table[index_a];
293
    const int beta  = (beta_table+52)[qp + h->slice_beta_offset];
293
    const int beta  = beta_table[qp + h->slice_beta_offset];
294 294
    if (alpha ==0 || beta == 0) return;
295 295

  
296 296
    if( bS[0] < 4 ) {
......
332 332
    qp1 = (qp + qp1 + 1) >> 1;
333 333
    qpc0 = (qpc + qpc0 + 1) >> 1;
334 334
    qpc1 = (qpc + qpc1 + 1) >> 1;
335
    qp_thresh = 15 - h->slice_alpha_c0_offset;
335
    qp_thresh = 15+52 - h->slice_alpha_c0_offset;
336 336
    if(qp <= qp_thresh && qp0 <= qp_thresh && qp1 <= qp_thresh &&
337 337
       qpc <= qp_thresh && qpc0 <= qp_thresh && qpc1 <= qp_thresh)
338 338
        return;

Also available in: Unified diff