Skip to content
This repository was archived by the owner on Jun 21, 2021. It is now read-only.

Commit 4f3345b

Browse files
committed
sbr_hf_calc_npatches(), sbr.h: Increase the maximum number of patches to 6
The maximum number of patches according to the spec is 5. However the Coding Technologies decoder check packages uses 6. http://samples.mplayerhq.hu/A-codecs/AAC/aacPlusDecoderCheckPackage_v2.1/
1 parent 287f2f0 commit 4f3345b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

libavcodec/aacsbr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,9 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
542542
if (sbr->patch_num_subbands[sbr->num_patches-1] < 3 && sbr->num_patches > 1)
543543
sbr->num_patches--;
544544

545-
if (sbr->num_patches > 5) { // Requirements (14496-3 sp04 p205)
545+
// Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5
546+
// However the Coding Technologies decoder check uses 6 patches
547+
if (sbr->num_patches > 6) {
546548
av_log(ac->avccontext, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches);
547549
return -1;
548550
}

libavcodec/sbr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ typedef struct {
133133
uint16_t f_tablenoise[6];
134134
uint16_t f_tablelim[29];
135135
uint8_t num_patches;
136-
uint8_t patch_num_subbands[5];
137-
uint8_t patch_start_subband[5];
136+
uint8_t patch_num_subbands[6];
137+
uint8_t patch_start_subband[6];
138138
float X_low[32][40][2];
139139
float X_high[64][40][2];
140140
DECLARE_ALIGNED(16, float, X)[2][32][64];

0 commit comments

Comments
 (0)