So this is kind of ambiguous in the spec... bs_amp_res is read in the
SBR header. If (bs_frame_class == FIXFIX && bs_num_env == 1)
bs_amp_res is set to zero. Those are both per frame variables and I'm
pretty sure the affect only lasts for one frame. That's how the refdec
seems to behave anyway.

4.B.18.6 Data quantization
The spectral envelope scalefactors are quantized in 3dB steps or in
1.5dB steps, dependent on the time frequency resolution of the current
SBR frame, and bs_amp_res. For the case where there is only one SBR
envelope per SBR frame and of SBR frame class FIXFIX, 1.5 dB steps are
always used, disregarded the value of bs_amp_res.
From 163e6670680f6da627f802a6816fe17773e4f6d5 Mon Sep 17 00:00:00 2001
From: Alex Converse <alex.conve...@gmail.com>
Date: Thu, 19 Nov 2009 19:00:10 -0500
Subject: [PATCH 08/12] bs_amp_res is overridden by 0 for (bs_frame_class == FIXFIX && bs_num_env == 1) only for the current frame.
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1"

This is a multi-part message in MIME format.
--------------1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
 aacsbr.c |    3 ++-
 aacsbr.h |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)


--------------1
Content-Type: text/x-patch; name="0008-bs_amp_res-is-overridden-by-0-for-bs_frame_class-FIX.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0008-bs_amp_res-is-overridden-by-0-for-bs_frame_class-FIX.patch"

diff --git a/aacsbr.c b/aacsbr.c
index d192b22..21c5e42 100644
--- a/aacsbr.c
+++ b/aacsbr.c
@@ -85,7 +85,7 @@ static unsigned int sbr_header(SpectralBandReplication *sbr, GetBitContext *gb)
     // Save last spectrum parameters variables to compare to new ones
     memcpy(&sbr->spectrum_params[0], &sbr->spectrum_params[1], sizeof(SpectrumParameters));
 
-    sbr->bs_amp_res                        = get_bits1(gb);
+    sbr->bs_amp_res_header                 = get_bits1(gb);
     sbr->spectrum_params[1].bs_start_freq  = get_bits(gb, 4);
     sbr->spectrum_params[1].bs_stop_freq   = get_bits(gb, 4);
     sbr->spectrum_params[1].bs_xover_band  = get_bits(gb, 3);
@@ -501,6 +501,7 @@ static int sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
     int i;
 
     ch_data->bs_num_env[0] = ch_data->bs_num_env[1];
+    sbr->bs_amp_res = sbr->bs_amp_res_header;
 
     switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
     case FIXFIX:
diff --git a/aacsbr.h b/aacsbr.h
index 3b0f4ef..f734f4c 100644
--- a/aacsbr.h
+++ b/aacsbr.h
@@ -109,6 +109,7 @@ typedef struct {
     uint8_t            start;
     // SBR header bitstream variables
     uint8_t            bs_amp_res;
+    uint8_t            bs_amp_res_header;
     SpectrumParameters spectrum_params[2];
     // if (bs_header_extra_2)
     uint8_t            bs_limiter_bands;

--------------1--


_______________________________________________
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to