We need information from the header to decode the sbr frame data.
From 725de88bb458afb05f718667eb409547d23e9f00 Mon Sep 17 00:00:00 2001
From: Alex Converse <[email protected]>
Date: Tue, 17 Nov 2009 13:23:26 -0500
Subject: [PATCH 07/12] Run SBR in pure upsampling mode until we get an SBR header.
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, 4 insertions(+), 0 deletions(-)


--------------1
Content-Type: text/x-patch; name="0007-Run-SBR-in-pure-upsampling-mode-until-we-get-an-SBR-.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0007-Run-SBR-in-pure-upsampling-mode-until-we-get-an-SBR-.patch"

diff --git a/aacsbr.c b/aacsbr.c
index c31daa0..d192b22 100644
--- a/aacsbr.c
+++ b/aacsbr.c
@@ -80,6 +80,8 @@ static unsigned int sbr_header(SpectralBandReplication *sbr, GetBitContext *gb)
     uint8_t bs_header_extra_1;
     uint8_t bs_header_extra_2;
 
+    sbr->start = 1;
+
     // Save last spectrum parameters variables to compare to new ones
     memcpy(&sbr->spectrum_params[0], &sbr->spectrum_params[1], sizeof(SpectrumParameters));
 
@@ -805,6 +807,7 @@ int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
     if (sbr->reset)
         sbr_reset(ac, sbr);
 
+    if (sbr->start)
     num_sbr_bits  += sbr_data(ac, sbr, gb, id_aac);
     num_align_bits = ((cnt << 3) - 4 - num_sbr_bits) & 7;
 
diff --git a/aacsbr.h b/aacsbr.h
index 50d04d1..3b0f4ef 100644
--- a/aacsbr.h
+++ b/aacsbr.h
@@ -106,6 +106,7 @@ typedef struct {
  * Spectral Band Replication
  */
 typedef struct {
+    uint8_t            start;
     // SBR header bitstream variables
     uint8_t            bs_amp_res;
     SpectrumParameters spectrum_params[2];

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


_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to