Mercurial > libavcodec.hg
comparison h264.c @ 5225:099c495618c1 libavcodec
Compute the dequant coefficient table ptr outside the loop,
this saves speed for the upcoming secondqp fix.
Patch by Andreas ªÓman % andreas A olebyn P nu %
Original thread:
Date: Jun 26, 2007 8:48 PM
subject: [FFmpeg-devel] Color corruption and seeking errors with H264 disc sources
author | gpoirier |
---|---|
date | Fri, 06 Jul 2007 07:55:37 +0000 |
parents | 2b72f9bc4f06 |
children | 65bffcc5571a |
comparison
equal
deleted
inserted
replaced
5224:6ced4aabe225 | 5225:099c495618c1 |
---|---|
5220 } | 5220 } |
5221 } | 5221 } |
5222 | 5222 |
5223 if(cbp&0x20){ | 5223 if(cbp&0x20){ |
5224 for(chroma_idx=0; chroma_idx<2; chroma_idx++){ | 5224 for(chroma_idx=0; chroma_idx<2; chroma_idx++){ |
5225 const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][chroma_qp]; | |
5225 for(i4x4=0; i4x4<4; i4x4++){ | 5226 for(i4x4=0; i4x4<4; i4x4++){ |
5226 const int index= 16 + 4*chroma_idx + i4x4; | 5227 const int index= 16 + 4*chroma_idx + i4x4; |
5227 if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][chroma_qp], 15) < 0){ | 5228 if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, qmul, 15) < 0){ |
5228 return -1; | 5229 return -1; |
5229 } | 5230 } |
5230 } | 5231 } |
5231 } | 5232 } |
5232 }else{ | 5233 }else{ |
6339 } | 6340 } |
6340 | 6341 |
6341 if( cbp&0x20 ) { | 6342 if( cbp&0x20 ) { |
6342 int c, i; | 6343 int c, i; |
6343 for( c = 0; c < 2; c++ ) { | 6344 for( c = 0; c < 2; c++ ) { |
6345 const uint32_t *qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp]; | |
6344 for( i = 0; i < 4; i++ ) { | 6346 for( i = 0; i < 4; i++ ) { |
6345 const int index = 16 + 4 * c + i; | 6347 const int index = 16 + 4 * c + i; |
6346 //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 ); | 6348 //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 ); |
6347 if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp], 15) < 0) | 6349 if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, qmul, 15) < 0) |
6348 return -1; | 6350 return -1; |
6349 } | 6351 } |
6350 } | 6352 } |
6351 } else { | 6353 } else { |
6352 uint8_t * const nnz= &h->non_zero_count_cache[0]; | 6354 uint8_t * const nnz= &h->non_zero_count_cache[0]; |