Mercurial > libavcodec.hg
comparison h264.c @ 1250:fa181d095027 libavcodec
optimizations
author | michaelni |
---|---|
date | Tue, 13 May 2003 00:46:42 +0000 |
parents | fc2a7eefa9cc |
children | 67ee8bab0f28 |
comparison
equal
deleted
inserted
replaced
1249:7ac0a77e5973 | 1250:fa181d095027 |
---|---|
2276 s->dsp.avg_h264_qpel_pixels_tab, s->dsp.avg_h264_chroma_pixels_tab); | 2276 s->dsp.avg_h264_qpel_pixels_tab, s->dsp.avg_h264_chroma_pixels_tab); |
2277 } | 2277 } |
2278 | 2278 |
2279 | 2279 |
2280 if(!IS_INTRA4x4(mb_type)){ | 2280 if(!IS_INTRA4x4(mb_type)){ |
2281 for(i=0; i<16; i++){ | 2281 if(s->codec_id == CODEC_ID_H264){ |
2282 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below | 2282 for(i=0; i<16; i++){ |
2283 uint8_t * const ptr= dest_y + h->block_offset[i]; | 2283 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below |
2284 if(s->codec_id == CODEC_ID_H264) | 2284 uint8_t * const ptr= dest_y + h->block_offset[i]; |
2285 h264_add_idct_c(ptr, h->mb + i*16, linesize); | 2285 h264_add_idct_c(ptr, h->mb + i*16, linesize); |
2286 else | 2286 } |
2287 } | |
2288 }else{ | |
2289 for(i=0; i<16; i++){ | |
2290 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below | |
2291 uint8_t * const ptr= dest_y + h->block_offset[i]; | |
2287 svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, IS_INTRA(mb_type) ? 1 : 0); | 2292 svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, IS_INTRA(mb_type) ? 1 : 0); |
2293 } | |
2288 } | 2294 } |
2289 } | 2295 } |
2290 } | 2296 } |
2291 | 2297 |
2292 if(!(s->flags&CODEC_FLAG_GRAY)){ | 2298 if(!(s->flags&CODEC_FLAG_GRAY)){ |
2293 chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp); | 2299 chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp); |
2294 chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp); | 2300 chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp); |
2295 for(i=16; i<16+4; i++){ | 2301 if(s->codec_id == CODEC_ID_H264){ |
2296 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ | 2302 for(i=16; i<16+4; i++){ |
2297 uint8_t * const ptr= dest_cb + h->block_offset[i]; | 2303 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ |
2298 if(s->codec_id == CODEC_ID_H264) | 2304 uint8_t * const ptr= dest_cb + h->block_offset[i]; |
2299 h264_add_idct_c(ptr, h->mb + i*16, uvlinesize); | 2305 h264_add_idct_c(ptr, h->mb + i*16, uvlinesize); |
2300 else | 2306 } |
2307 } | |
2308 for(i=20; i<20+4; i++){ | |
2309 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ | |
2310 uint8_t * const ptr= dest_cr + h->block_offset[i]; | |
2311 h264_add_idct_c(ptr, h->mb + i*16, uvlinesize); | |
2312 } | |
2313 } | |
2314 }else{ | |
2315 for(i=16; i<16+4; i++){ | |
2316 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ | |
2317 uint8_t * const ptr= dest_cb + h->block_offset[i]; | |
2301 svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2); | 2318 svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2); |
2302 } | 2319 } |
2303 } | 2320 } |
2304 for(i=20; i<20+4; i++){ | 2321 for(i=20; i<20+4; i++){ |
2305 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ | 2322 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ |
2306 uint8_t * const ptr= dest_cr + h->block_offset[i]; | 2323 uint8_t * const ptr= dest_cr + h->block_offset[i]; |
2307 if(s->codec_id == CODEC_ID_H264) | |
2308 h264_add_idct_c(ptr, h->mb + i*16, uvlinesize); | |
2309 else | |
2310 svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2); | 2324 svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2); |
2325 } | |
2311 } | 2326 } |
2312 } | 2327 } |
2313 } | 2328 } |
2314 } | 2329 } |
2315 | 2330 |