avcodec/sbc: Use union to save space

One buffer is encoder-only, the other decoder-only.
Also move crc_ctx before the buffers (into padding).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-03-28 11:25:38 +01:00
parent 7e032d6963
commit 1c9f56f969
+8 -6
View File
@@ -102,16 +102,18 @@ struct sbc_frame {
/* bit number x set means joint stereo has been used in subband x */
uint8_t joint;
const AVCRC *crc_ctx;
/* only the lower 4 bits of every element are to be used */
DECLARE_ALIGNED(SBC_ALIGN, uint32_t, scale_factor)[2][8];
/* raw integer subband samples in the frame */
DECLARE_ALIGNED(SBC_ALIGN, int32_t, sb_sample_f)[16][2][8];
union {
/* raw integer subband samples in the frame - encoder only */
DECLARE_ALIGNED(SBC_ALIGN, int32_t, sb_sample_f)[16][2][8];
/* modified subband samples */
DECLARE_ALIGNED(SBC_ALIGN, int32_t, sb_sample)[16][2][8];
const AVCRC *crc_ctx;
/* modified subband samples - decoder only */
DECLARE_ALIGNED(SBC_ALIGN, int32_t, sb_sample)[16][2][8];
};
};
uint8_t ff_sbc_crc8(const AVCRC *crc_ctx, const uint8_t *data, size_t len);