43 const SUINT z0= block[i + 4*0] + (unsigned)block[i + 4*2];
44 const SUINT z1= block[i + 4*0] - (unsigned)block[i + 4*2];
45 const SUINT z2= (block[i + 4*1]>>1) - (
unsigned)block[i + 4*3];
46 const SUINT z3= block[i + 4*1] + (unsigned)(block[i + 4*3]>>1);
48 block[i + 4*0]= z0 + z3;
49 block[i + 4*1]= z1 + z2;
50 block[i + 4*2]= z1 - z2;
51 block[i + 4*3]= z0 - z3;
55 const SUINT z0= block[0 + 4*i] + (
SUINT)block[2 + 4*i];
56 const SUINT z1= block[0 + 4*i] - (
SUINT)block[2 + 4*i];
57 const SUINT z2= (block[1 + 4*i]>>1) - (
SUINT)block[3 + 4*i];
58 const SUINT z3= block[1 + 4*i] + (
SUINT)(block[3 + 4*i]>>1);
66 memset(block, 0, 16 *
sizeof(
dctcoef));
77 for( i = 0; i < 8; i++ )
79 const unsigned int a0 = block[i+0*8] + (unsigned)block[i+4*8];
80 const unsigned int a2 = block[i+0*8] - (unsigned)block[i+4*8];
81 const unsigned int a4 = (block[i+2*8]>>1) - (
unsigned)block[i+6*8];
82 const unsigned int a6 = (block[i+6*8]>>1) + (
unsigned)block[i+2*8];
84 const unsigned int b0 = a0 + a6;
85 const unsigned int b2 = a2 +
a4;
86 const unsigned int b4 = a2 -
a4;
87 const unsigned int b6 = a0 - a6;
89 const int a1 = -block[i+3*8] + (unsigned)block[i+5*8] - block[i+7*8] - (block[i+7*8]>>1);
90 const int a3 = block[i+1*8] + (unsigned)block[i+7*8] - block[i+3*8] - (block[i+3*8]>>1);
91 const int a5 = -block[i+1*8] + (unsigned)block[i+7*8] + block[i+5*8] + (block[i+5*8]>>1);
92 const int a7 = block[i+3*8] + (unsigned)block[i+5*8] + block[i+1*8] + (block[i+1*8]>>1);
94 const int b1 = (a7>>2) + (
unsigned)
a1;
95 const int b3 = (unsigned)a3 + (a5>>2);
96 const int b5 = (a3>>2) - (
unsigned)
a5;
97 const int b7 = (unsigned)a7 - (a1>>2);
99 block[i+0*8] = b0 + b7;
100 block[i+7*8] = b0 - b7;
101 block[i+1*8] = b2 + b5;
102 block[i+6*8] = b2 - b5;
103 block[i+2*8] = b4 + b3;
104 block[i+5*8] = b4 - b3;
105 block[i+3*8] = b6 + b1;
106 block[i+4*8] = b6 - b1;
108 for( i = 0; i < 8; i++ )
110 const unsigned a0 = block[0+i*8] + (unsigned)block[4+i*8];
111 const unsigned a2 = block[0+i*8] - (unsigned)block[4+i*8];
112 const unsigned a4 = (block[2+i*8]>>1) - (
unsigned)block[6+i*8];
113 const unsigned a6 = (block[6+i*8]>>1) + (
unsigned)block[2+i*8];
115 const unsigned b0 = a0 + a6;
116 const unsigned b2 = a2 +
a4;
117 const unsigned b4 = a2 -
a4;
118 const unsigned b6 = a0 - a6;
120 const int a1 = -(unsigned)block[3+i*8] + block[5+i*8] - block[7+i*8] - (block[7+i*8]>>1);
121 const int a3 = (unsigned)block[1+i*8] + block[7+i*8] - block[3+i*8] - (block[3+i*8]>>1);
122 const int a5 = -(unsigned)block[1+i*8] + block[7+i*8] + block[5+i*8] + (block[5+i*8]>>1);
123 const int a7 = (unsigned)block[3+i*8] + block[5+i*8] + block[1+i*8] + (block[1+i*8]>>1);
125 const unsigned b1 = (a7>>2) + (
unsigned)
a1;
126 const unsigned b3 = (unsigned)a3 + (a5>>2);
127 const unsigned b5 = (a3>>2) - (
unsigned)
a5;
128 const unsigned b7 = (unsigned)a7 - (a1>>2);
140 memset(block, 0, 64 *
sizeof(
dctcoef));
148 int dc = (block[0] + 32) >> 6;
151 for( j = 0; j < 4; j++ )
153 for( i = 0; i < 4; i++ )
163 int dc = (block[0] + 32) >> 6;
166 for( j = 0; j < 8; j++ )
168 for( i = 0; i < 8; i++ )
177 int nnz = nnzc[
scan8[i] ];
195 for(i=0; i<16; i+=4){
196 int nnz = nnzc[
scan8[i] ];
207 for(i=j*16; i<j*16+4; i++){
220 for(i=j*16; i<j*16+4; i++){
229 for(i=j*16+4; i<j*16+8; i++){
230 if(nnzc[
scan8[i+4] ])
251 const int z0= input[4*i+0] + input[4*i+1];
252 const int z1= input[4*i+0] - input[4*i+1];
253 const int z2= input[4*i+2] - input[4*i+3];
254 const int z3= input[4*i+2] + input[4*i+3];
263 const int offset= x_offset[i];
264 const SUINT z0= temp[4*0+i] + temp[4*2+i];
265 const SUINT z1= temp[4*0+i] - temp[4*2+i];
266 const SUINT z2= temp[4*1+i] - temp[4*3+i];
267 const SUINT z3= temp[4*1+i] + temp[4*3+i];
269 output[stride* 0+
offset]= (
int)((z0 + z3)*qmul + 128 ) >> 8;
270 output[stride* 1+
offset]= (
int)((z1 + z2)*qmul + 128 ) >> 8;
271 output[stride* 4+
offset]= (
int)((z1 - z2)*qmul + 128 ) >> 8;
272 output[stride* 5+
offset]= (
int)((z0 - z3)*qmul + 128 ) >> 8;
279 const int xStride= 16;
282 static const uint8_t x_offset[2]={0, 16};
286 temp[2*i+0] = block[stride*i + xStride*0] + block[stride*i + xStride*1];
287 temp[2*i+1] = block[stride*i + xStride*0] - block[stride*i + xStride*1];
291 const int offset= x_offset[i];
292 const SUINT z0= temp[2*0+i] + temp[2*2+i];
293 const SUINT z1= temp[2*0+i] - temp[2*2+i];
294 const SUINT z2= temp[2*1+i] - temp[2*3+i];
295 const SUINT z3= temp[2*1+i] + temp[2*3+i];
297 block[stride*0+
offset]= (
int)((z0 + z3)*qmul + 128) >> 8;
298 block[stride*1+
offset]= (
int)((z1 + z2)*qmul + 128) >> 8;
299 block[stride*2+
offset]= (
int)((z1 - z2)*qmul + 128) >> 8;
300 block[stride*3+
offset]= (
int)((z0 - z3)*qmul + 128) >> 8;
306 const int xStride= 16;
310 a= block[stride*0 + xStride*0];
311 b= block[stride*0 + xStride*1];
312 c= block[stride*1 + xStride*0];
313 d= block[stride*1 + xStride*1];
320 block[stride*0 + xStride*0]= (
int)((a+c)*qmul) >> 7;
321 block[stride*0 + xStride*1]= (
int)((e+b)*qmul) >> 7;
322 block[stride*1 + xStride*0]= (
int)((a-c)*qmul) >> 7;
323 block[stride*1 + xStride*1]= (
int)((e-b)*qmul) >> 7;
void FUNCC() ff_h264_idct8_dc_add(uint8_t *_dst, int16_t *_block, int stride)
void FUNCC() ff_h264_idct8_add(uint8_t *_dst, int16_t *_block, int stride)
void FUNCC() ff_h264_idct_add16(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
static const uint8_t offset[127][2]
void FUNCC() ff_h264_idct_add(uint8_t *_dst, int16_t *_block, int stride)
H.264 / AVC / MPEG-4 part10 codec.
void FUNCC() ff_h264_chroma_dc_dequant_idct(int16_t *_block, int qmul)
void FUNCC() ff_h264_idct8_add4(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
static const uint8_t scan8[16 *3+3]
void FUNCC() ff_h264_luma_dc_dequant_idct(int16_t *_output, int16_t *_input, int qmul)
IDCT transforms the 16 dc values and dequantizes them.
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> dc
void FUNCC() ff_h264_idct_dc_add(uint8_t *_dst, int16_t *_block, int stride)
common internal and external API header
void FUNCC() ff_h264_chroma422_dc_dequant_idct(int16_t *_block, int qmul)
void FUNCC() ff_h264_idct_add8_422(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
void FUNCC() ff_h264_idct_add8(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
void FUNCC() ff_h264_idct_add16intra(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15 *8])