diff options
author | Mans Rullgard <mans@mansr.com> | 2011-07-20 09:46:18 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-07-20 16:13:04 +0100 |
commit | 7b4ee3a21d7c7419b485bf7af3b2795b9c3e89ea (patch) | |
tree | 86fd5f73d767442ab2b08816d50dcc02c41f1c87 /libavcodec/h264idct_template.c | |
parent | 89cc8a316d252d37a14906da9c170afbc7488326 (diff) | |
download | ffmpeg-7b4ee3a21d7c7419b485bf7af3b2795b9c3e89ea.tar.gz |
Remove h264_lowres_idct_put/add functions
Use of these has been broken ever since the h264 idct was changed
to always use transposed inputs. Furthermore, they were only
ever used if some *other* non-default idct was requested.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/h264idct_template.c')
-rw-r--r-- | libavcodec/h264idct_template.c | 57 |
1 files changed, 23 insertions, 34 deletions
diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c index 55c1d3a4d8..ba5571576d 100644 --- a/libavcodec/h264idct_template.c +++ b/libavcodec/h264idct_template.c @@ -46,52 +46,41 @@ static const uint8_t scan8[16*3]={ }; #endif -static av_always_inline void FUNCC(idct_internal)(uint8_t *_dst, DCTELEM *_block, int stride, int block_stride, int shift, int add){ +void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride) +{ int i; INIT_CLIP pixel *dst = (pixel*)_dst; dctcoef *block = (dctcoef*)_block; stride /= sizeof(pixel); - block[0] += 1<<(shift-1); + block[0] += 1 << 5; for(i=0; i<4; i++){ - const int z0= block[i + block_stride*0] + block[i + block_stride*2]; - const int z1= block[i + block_stride*0] - block[i + block_stride*2]; - const int z2= (block[i + block_stride*1]>>1) - block[i + block_stride*3]; - const int z3= block[i + block_stride*1] + (block[i + block_stride*3]>>1); - - block[i + block_stride*0]= z0 + z3; - block[i + block_stride*1]= z1 + z2; - block[i + block_stride*2]= z1 - z2; - block[i + block_stride*3]= z0 - z3; + const int z0= block[i + 4*0] + block[i + 4*2]; + const int z1= block[i + 4*0] - block[i + 4*2]; + const int z2= (block[i + 4*1]>>1) - block[i + 4*3]; + const int z3= block[i + 4*1] + (block[i + 4*3]>>1); + + block[i + 4*0]= z0 + z3; + block[i + 4*1]= z1 + z2; + block[i + 4*2]= z1 - z2; + block[i + 4*3]= z0 - z3; } for(i=0; i<4; i++){ - const int z0= block[0 + block_stride*i] + block[2 + block_stride*i]; - const int z1= block[0 + block_stride*i] - block[2 + block_stride*i]; - const int z2= (block[1 + block_stride*i]>>1) - block[3 + block_stride*i]; - const int z3= block[1 + block_stride*i] + (block[3 + block_stride*i]>>1); - - dst[i + 0*stride]= CLIP(add*dst[i + 0*stride] + ((z0 + z3) >> shift)); - dst[i + 1*stride]= CLIP(add*dst[i + 1*stride] + ((z1 + z2) >> shift)); - dst[i + 2*stride]= CLIP(add*dst[i + 2*stride] + ((z1 - z2) >> shift)); - dst[i + 3*stride]= CLIP(add*dst[i + 3*stride] + ((z0 - z3) >> shift)); + const int z0= block[0 + 4*i] + block[2 + 4*i]; + const int z1= block[0 + 4*i] - block[2 + 4*i]; + const int z2= (block[1 + 4*i]>>1) - block[3 + 4*i]; + const int z3= block[1 + 4*i] + (block[3 + 4*i]>>1); + + dst[i + 0*stride]= CLIP(dst[i + 0*stride] + ((z0 + z3) >> 6)); + dst[i + 1*stride]= CLIP(dst[i + 1*stride] + ((z1 + z2) >> 6)); + dst[i + 2*stride]= CLIP(dst[i + 2*stride] + ((z1 - z2) >> 6)); + dst[i + 3*stride]= CLIP(dst[i + 3*stride] + ((z0 - z3) >> 6)); } } -void FUNCC(ff_h264_idct_add)(uint8_t *dst, DCTELEM *block, int stride){ - FUNCC(idct_internal)(dst, block, stride, 4, 6, 1); -} - -void FUNCC(ff_h264_lowres_idct_add)(uint8_t *dst, int stride, DCTELEM *block){ - FUNCC(idct_internal)(dst, block, stride, 8, 3, 1); -} - -void FUNCC(ff_h264_lowres_idct_put)(uint8_t *dst, int stride, DCTELEM *block){ - FUNCC(idct_internal)(dst, block, stride, 8, 3, 0); -} - void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){ int i; INIT_CLIP @@ -200,7 +189,7 @@ void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *b int nnz = nnzc[ scan8[i] ]; if(nnz){ if(nnz==1 && ((dctcoef*)block)[i*16]) FUNCC(ff_h264_idct_dc_add)(dst + block_offset[i], block + i*16*sizeof(pixel), stride); - else FUNCC(idct_internal )(dst + block_offset[i], block + i*16*sizeof(pixel), stride, 4, 6, 1); + else FUNCC(ff_h264_idct_add )(dst + block_offset[i], block + i*16*sizeof(pixel), stride); } } } @@ -208,7 +197,7 @@ void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *b void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ int i; for(i=0; i<16; i++){ - if(nnzc[ scan8[i] ]) FUNCC(idct_internal )(dst + block_offset[i], block + i*16*sizeof(pixel), stride, 4, 6, 1); + if(nnzc[ scan8[i] ]) FUNCC(ff_h264_idct_add )(dst + block_offset[i], block + i*16*sizeof(pixel), stride); else if(((dctcoef*)block)[i*16]) FUNCC(ff_h264_idct_dc_add)(dst + block_offset[i], block + i*16*sizeof(pixel), stride); } } |