diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-06 02:59:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-06 02:59:49 +0200 |
commit | 11d78415ca1beaa39303c280d7896024edc45aa7 (patch) | |
tree | cea1da5ffc8ae3e09d7375241a1a334e27703610 /libavcodec | |
parent | ee6db0de3760ceb7b7a9968a5322c1d8e8e23861 (diff) | |
parent | 5371803dd5d9f7bbc62d68274084d25f10a8dc61 (diff) | |
download | ffmpeg-11d78415ca1beaa39303c280d7896024edc45aa7.tar.gz |
Merge remote branch 'qatar/master'
* qatar/master:
psymodel: extend API to include PE and bit allocation.
avio: always compile dyn_buf functions
Remove unnecessary parameter from ff_thread_init() and fix behavior
Revert "aac_latm_dec: use aac context and aac m4ac"
configure: tell user if libva is enabled like the rest of external libs.
Add silence support for AV_SAMPLE_FMT_U8.
avio: make URL_PROTOCOL_FLAG_NESTED_SCHEME internal
avio: deprecate av_url_read_seek
avio: deprecate av_url_read_pause
ac3enc: NEON optimised extract_exponents
Conflicts:
libavcodec/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aacdec.c | 4 | ||||
-rw-r--r-- | libavcodec/arm/ac3dsp_init_arm.c | 2 | ||||
-rw-r--r-- | libavcodec/arm/ac3dsp_neon.S | 20 | ||||
-rw-r--r-- | libavcodec/psymodel.h | 9 | ||||
-rw-r--r-- | libavcodec/utils.c | 1 |
5 files changed, 33 insertions, 3 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index e7b312c415..5f86b89b38 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -2266,6 +2266,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx, GetBitContext *gb) { AVCodecContext *avctx = latmctx->aac_ctx.avctx; + MPEG4AudioConfig m4ac; int config_start_bit = get_bits_count(gb); int bits_consumed, esize; @@ -2275,8 +2276,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx, return AVERROR_INVALIDDATA; } else { bits_consumed = - decode_audio_specific_config(&latmctx->aac_ctx, avctx, - &latmctx->aac_ctx.m4ac, + decode_audio_specific_config(NULL, avctx, &m4ac, gb->buffer + (config_start_bit / 8), get_bits_left(gb) / 8); diff --git a/libavcodec/arm/ac3dsp_init_arm.c b/libavcodec/arm/ac3dsp_init_arm.c index 8534c9b97c..9f01507853 100644 --- a/libavcodec/arm/ac3dsp_init_arm.c +++ b/libavcodec/arm/ac3dsp_init_arm.c @@ -28,6 +28,7 @@ int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len); void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift); void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift); void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len); +void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs); void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd, int start, int end, @@ -50,5 +51,6 @@ av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact) c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon; c->ac3_rshift_int32 = ff_ac3_rshift_int32_neon; c->float_to_fixed24 = ff_float_to_fixed24_neon; + c->extract_exponents = ff_ac3_extract_exponents_neon; } } diff --git a/libavcodec/arm/ac3dsp_neon.S b/libavcodec/arm/ac3dsp_neon.S index d33d978d7c..946b39f25b 100644 --- a/libavcodec/arm/ac3dsp_neon.S +++ b/libavcodec/arm/ac3dsp_neon.S @@ -92,3 +92,23 @@ function ff_float_to_fixed24_neon, export=1 bgt 1b bx lr endfunc + +function ff_ac3_extract_exponents_neon, export=1 + vmov.i32 q14, #24 + vmov.i32 q15, #8 +1: + vld1.32 {q0}, [r1,:128] + vabs.s32 q1, q0 + vclz.i32 q3, q1 + vsub.i32 q3, q3, q15 + vcge.s32 q2, q3, q14 + vbit q3, q14, q2 + vbic q0, q0, q2 + vmovn.i32 d6, q3 + vmovn.i16 d6, q3 + vst1.32 {q0}, [r1,:128]! + vst1.32 {d6[0]}, [r0,:32]! + subs r2, r2, #4 + bgt 1b + bx lr +endfunc diff --git a/libavcodec/psymodel.h b/libavcodec/psymodel.h index fc2f6d954c..a89b64c308 100644 --- a/libavcodec/psymodel.h +++ b/libavcodec/psymodel.h @@ -26,6 +26,8 @@ /** maximum possible number of bands */ #define PSY_MAX_BANDS 128 +/** maximum number of channels */ +#define PSY_MAX_CHANS 20 /** * single band psychoacoustic information @@ -62,6 +64,13 @@ typedef struct FFPsyContext { int *num_bands; ///< number of scalefactor bands for possible frame sizes int num_lens; ///< number of scalefactor band sets + float pe[PSY_MAX_CHANS]; ///< total PE for each channel in the frame + + struct { + int size; ///< size of the bitresevoir in bits + int bits; ///< number of bits used in the bitresevoir + } bitres; + void* model_priv_data; ///< psychoacoustic model implementation private data } FFPsyContext; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 42689e03b9..a75c9ce7ea 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1337,7 +1337,6 @@ void ff_thread_await_progress(AVFrame *f, int progress, int field) int avcodec_thread_init(AVCodecContext *s, int thread_count) { s->thread_count = thread_count; - s->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE; return ff_thread_init(s); } |