On 18 October 2013 01:12, Alex Converse <[email protected]> wrote:
> This does not include support for LD SBR, epTool, data resialiance, nor
> the 960 transform family.
> ---
> Changelog | 1 +
> libavcodec/aac.h | 2 +-
> libavcodec/aacdec.c | 208 ++++++++++++++++++----
> libavcodec/aactab.c | 483
> +++++++++++++++++++++++++++++++++++++++++++++++++++
> libavcodec/aactab.h | 1 +
> libavcodec/version.h | 2 +-
> 6 files changed, 662 insertions(+), 35 deletions(-)
>
> diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
> index 824839a..4322d7d 100644
> --- a/libavcodec/aacdec.c
> +++ b/libavcodec/aacdec.c
> @@ -779,6 +779,69 @@ static int decode_ga_specific_config(AACContext *ac,
> AVCodecContext *avctx,
> return 0;
> }
>
> +static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
> + GetBitContext *gb,
> + MPEG4AudioConfig *m4ac,
> + int channel_config)
> +{
> + int ret, ep_config, res_flags;
> + uint8_t layout_map[MAX_ELEM_ID*4][3];
> + int tags = 0;
> + const int ELDEXT_TERM = 0;
> +
> + m4ac->ps = 0;
> + m4ac->sbr = 0;
> +
> + if (get_bits1(gb)) { // frameLengthFlag
> + avpriv_request_sample(avctx, "960/120 MDCT window");
> + return AVERROR_PATCHWELCOME;
> + }
> +
> + res_flags = get_bits(gb, 3);
> + if (res_flags) {
> + av_log(avctx, AV_LOG_ERROR,
> + "AAC data resilience not supported (flags %x)\n",
> + res_flags);
> + return AVERROR_PATCHWELCOME;
> + }
> +
> + if (get_bits1(gb)) { // ldSbrPresentFlag
> + av_log(avctx, AV_LOG_ERROR, "Low Delay SBR not supported\n");
> + return AVERROR_PATCHWELCOME;
> + }
> +
> + while (get_bits(gb, 4) != ELDEXT_TERM) {
> + int len = get_bits(gb, 4);
> + if (len == 15)
> + len += get_bits(gb, 8);
> + if (len == 15 + 255)
> + len += get_bits(gb, 16);
> + skip_bits_long(gb, 8 * len);
> + if (get_bits_left(gb) < 4) {
> + av_log(ac->avctx, AV_LOG_ERROR, overread_err);
> + return AVERROR_INVALIDDATA;
> + }
why not check before skipping?
> + break;
> + }
> +
> +
> + if ((ret = set_default_channel_config(avctx, layout_map,
> + &tags, channel_config)))
> + return ret;
> +
> + if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR,
> 0)))
> + return ret;
> +
> + ep_config = get_bits(gb, 2);
> + if (ep_config) {
> + av_log(avctx, AV_LOG_ERROR,
> + "epConfig %d is not supported.\n",
> + ep_config);
> + return AVERROR_PATCHWELCOME;
> + }
> + return 0;
> +}
> +
> /**
> * Decode audio specific configuration; reference: table 1.13.
> *
[...]
In general looks quite good to me (except for codec itself and AAC
design in general but it's definitely not your fault).
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel