comparison mpegvideo.c @ 1497:37e16bd36d2c libavcodec

rd cbp + single coeff elimination fix
author michaelni
date Thu, 02 Oct 2003 08:52:37 +0000
parents 3ee63c12ea30
children 010f76d07a27
comparison
equal deleted inserted replaced
1496:b78a9ba6a568 1497:37e16bd36d2c
3023 // of improve it. Just INTRADC clipping deserves changes in quantizer 3023 // of improve it. Just INTRADC clipping deserves changes in quantizer
3024 if (overflow) clip_coeffs(s, s->block[i], s->block_last_index[i]); 3024 if (overflow) clip_coeffs(s, s->block[i], s->block_last_index[i]);
3025 }else 3025 }else
3026 s->block_last_index[i]= -1; 3026 s->block_last_index[i]= -1;
3027 } 3027 }
3028 if(s->flags & CODEC_FLAG_CBP_RD){
3029 for(i=0;i<6;i++) {
3030 if(s->block_last_index[i] == -1)
3031 s->coded_score[i]= INT_MAX/256;
3032 }
3033 }
3034 3028
3035 if(s->luma_elim_threshold && !s->mb_intra) 3029 if(s->luma_elim_threshold && !s->mb_intra)
3036 for(i=0; i<4; i++) 3030 for(i=0; i<4; i++)
3037 dct_single_coeff_elimination(s, i, s->luma_elim_threshold); 3031 dct_single_coeff_elimination(s, i, s->luma_elim_threshold);
3038 if(s->chroma_elim_threshold && !s->mb_intra) 3032 if(s->chroma_elim_threshold && !s->mb_intra)
3039 for(i=4; i<6; i++) 3033 for(i=4; i<6; i++)
3040 dct_single_coeff_elimination(s, i, s->chroma_elim_threshold); 3034 dct_single_coeff_elimination(s, i, s->chroma_elim_threshold);
3035
3036 if(s->flags & CODEC_FLAG_CBP_RD){
3037 for(i=0;i<6;i++) {
3038 if(s->block_last_index[i] == -1)
3039 s->coded_score[i]= INT_MAX/256;
3040 }
3041 }
3041 } 3042 }
3042 3043
3043 if((s->flags&CODEC_FLAG_GRAY) && s->mb_intra){ 3044 if((s->flags&CODEC_FLAG_GRAY) && s->mb_intra){
3044 s->block_last_index[4]= 3045 s->block_last_index[4]=
3045 s->block_last_index[5]= 0; 3046 s->block_last_index[5]= 0;