aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-05-13 00:46:42 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-05-13 00:46:42 +0000
commit4704097a2b557fa9e58def0956dbdef7842a3fd3 (patch)
treec1ad308caf530a66679e417e5bf834ce7c23ca75 /libavcodec/h264.c
parentf138f88364f88cdc1ecd99f55b38c73cd5c7919e (diff)
downloadffmpeg-4704097a2b557fa9e58def0956dbdef7842a3fd3.tar.gz
optimizations
Originally committed as revision 1867 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c49
1 files changed, 32 insertions, 17 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index c52758ed92..63d1af1746 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2278,13 +2278,19 @@ static void hl_decode_mb(H264Context *h){
if(!IS_INTRA4x4(mb_type)){
- for(i=0; i<16; i++){
- if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below
- uint8_t * const ptr= dest_y + h->block_offset[i];
- if(s->codec_id == CODEC_ID_H264)
+ if(s->codec_id == CODEC_ID_H264){
+ for(i=0; i<16; i++){
+ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below
+ uint8_t * const ptr= dest_y + h->block_offset[i];
h264_add_idct_c(ptr, h->mb + i*16, linesize);
- else
+ }
+ }
+ }else{
+ for(i=0; i<16; i++){
+ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below
+ uint8_t * const ptr= dest_y + h->block_offset[i];
svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, IS_INTRA(mb_type) ? 1 : 0);
+ }
}
}
}
@@ -2292,22 +2298,31 @@ static void hl_decode_mb(H264Context *h){
if(!(s->flags&CODEC_FLAG_GRAY)){
chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp);
chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp);
- for(i=16; i<16+4; i++){
- if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
- uint8_t * const ptr= dest_cb + h->block_offset[i];
- if(s->codec_id == CODEC_ID_H264)
+ if(s->codec_id == CODEC_ID_H264){
+ for(i=16; i<16+4; i++){
+ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
+ uint8_t * const ptr= dest_cb + h->block_offset[i];
h264_add_idct_c(ptr, h->mb + i*16, uvlinesize);
- else
- svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2);
+ }
}
- }
- for(i=20; i<20+4; i++){
- if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
- uint8_t * const ptr= dest_cr + h->block_offset[i];
- if(s->codec_id == CODEC_ID_H264)
+ for(i=20; i<20+4; i++){
+ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
+ uint8_t * const ptr= dest_cr + h->block_offset[i];
h264_add_idct_c(ptr, h->mb + i*16, uvlinesize);
- else
+ }
+ }
+ }else{
+ for(i=16; i<16+4; i++){
+ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
+ uint8_t * const ptr= dest_cb + h->block_offset[i];
svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2);
+ }
+ }
+ for(i=20; i<20+4; i++){
+ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
+ uint8_t * const ptr= dest_cr + h->block_offset[i];
+ svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2);
+ }
}
}
}