Lines Matching refs:subpacket
159 COOKSubpacket subpacket[MAX_SUBPACKETS];
206 if (q->subpacket[i].joint_stereo == 1) {
207 result |= init_vlc(&q->subpacket[i].ccpl, 6, (1 << q->subpacket[i].js_vlc_bits) - 1,
208 ccpl_huffbits[q->subpacket[i].js_vlc_bits - 2], 1, 1,
209 ccpl_huffcodes[q->subpacket[i].js_vlc_bits - 2], 2, 2, 0);
210 av_log(q->avctx, AV_LOG_DEBUG, "subpacket %i Joint-stereo VLC used.\n", i);
328 ff_free_vlc(&q->subpacket[i].ccpl);
862 * First part of subpacket decoding:
902 * Final part of subpacket decoding:
924 * Cook subpacket decoding. This function returns one decoded subpacket,
1001 /* estimate subpacket sizes */
1002 q->subpacket[0].size = avctx->block_align;
1005 q->subpacket[i].size = 2 * buf[avctx->block_align - q->num_subpackets + i];
1006 q->subpacket[0].size -= q->subpacket[i].size + 1;
1007 if (q->subpacket[0].size < 0) {
1009 "frame subpacket size total > avctx->block_align!\n");
1016 q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size * 8) >>
1017 q->subpacket[i].bits_per_subpdiv;
1018 q->subpacket[i].ch_idx = chidx;
1020 "subpacket[%i] size %i js %i %i block_align %i\n",
1021 i, q->subpacket[i].size, q->subpacket[i].joint_stereo, offset,
1024 if ((ret = decode_subpacket(q, &q->subpacket[i], buf + offset, samples)) < 0)
1026 offset += q->subpacket[i].size;
1027 chidx += q->subpacket[i].num_channels;
1028 av_log(avctx, AV_LOG_DEBUG, "subpacket[%i] %i %i\n",
1029 i, q->subpacket[i].size * 8, get_bits_count(&q->gb));
1051 av_log(q->avctx, AV_LOG_ERROR, "cookversion=%x\n", q->subpacket[0].cookversion);
1052 if (q->subpacket[0].cookversion > STEREO) {
1053 PRINT("js_subband_start", q->subpacket[0].js_subband_start);
1054 PRINT("js_vlc_bits", q->subpacket[0].js_vlc_bits);
1060 PRINT("samples_per_channel", q->subpacket[0].samples_per_channel);
1061 PRINT("samples_per_frame", q->subpacket[0].samples_per_frame);
1062 PRINT("subbands", q->subpacket[0].subbands);
1063 PRINT("js_subband_start", q->subpacket[0].js_subband_start);
1064 PRINT("log2_numvector_size", q->subpacket[0].log2_numvector_size);
1065 PRINT("numvector_size", q->subpacket[0].numvector_size);
1066 PRINT("total_subbands", q->subpacket[0].total_subbands);
1119 q->subpacket[s].cookversion = bytestream_get_be32(&edata_ptr);
1120 q->subpacket[s].samples_per_frame = bytestream_get_be16(&edata_ptr);
1121 q->subpacket[s].subbands = bytestream_get_be16(&edata_ptr);
1126 q->subpacket[s].js_subband_start = bytestream_get_be16(&edata_ptr);
1127 q->subpacket[s].js_vlc_bits = bytestream_get_be16(&edata_ptr);
1132 q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame / q->nb_channels;
1133 q->subpacket[s].bits_per_subpacket = avctx->block_align * 8;
1136 q->subpacket[s].log2_numvector_size = 5;
1137 q->subpacket[s].total_subbands = q->subpacket[s].subbands;
1138 q->subpacket[s].num_channels = 1;
1142 av_log(avctx, AV_LOG_DEBUG, "subpacket[%i].cookversion=%x\n", s,
1143 q->subpacket[s].cookversion);
1144 q->subpacket[s].joint_stereo = 0;
1145 switch (q->subpacket[s].cookversion) {
1155 q->subpacket[s].bits_per_subpdiv = 1;
1156 q->subpacket[s].num_channels = 2;
1167 q->subpacket[s].total_subbands = q->subpacket[s].subbands +
1168 q->subpacket[s].js_subband_start;
1169 q->subpacket[s].joint_stereo = 1;
1170 q->subpacket[s].num_channels = 2;
1172 if (q->subpacket[s].samples_per_channel > 256) {
1173 q->subpacket[s].log2_numvector_size = 6;
1175 if (q->subpacket[s].samples_per_channel > 512) {
1176 q->subpacket[s].log2_numvector_size = 7;
1182 channel_mask |= q->subpacket[s].channel_mask = bytestream_get_be32(&edata_ptr);
1184 if (cook_count_channels(q->subpacket[s].channel_mask) > 1) {
1185 q->subpacket[s].total_subbands = q->subpacket[s].subbands +
1186 q->subpacket[s].js_subband_start;
1187 q->subpacket[s].joint_stereo = 1;
1188 q->subpacket[s].num_channels = 2;
1189 q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame >> 1;
1191 if (q->subpacket[s].samples_per_channel > 256) {
1192 q->subpacket[s].log2_numvector_size = 6;
1194 if (q->subpacket[s].samples_per_channel > 512) {
1195 q->subpacket[s].log2_numvector_size = 7;
1198 q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame;
1206 if (s > 1 && q->subpacket[s].samples_per_channel != q->samples_per_channel) {
1210 q->samples_per_channel = q->subpacket[0].samples_per_channel;
1214 q->subpacket[s].numvector_size = (1 << q->subpacket[s].log2_numvector_size);
1217 if (q->subpacket[s].total_subbands > 53) {
1222 if ((q->subpacket[s].js_vlc_bits > 6) ||
1223 (q->subpacket[s].js_vlc_bits < 2 * q->subpacket[s].joint_stereo)) {
1225 q->subpacket[s].js_vlc_bits, 2 * q->subpacket[s].joint_stereo);
1229 if (q->subpacket[s].subbands > 50) {
1233 q->subpacket[s].gains1.now = q->subpacket[s].gain_1;
1234 q->subpacket[s].gains1.previous = q->subpacket[s].gain_2;
1235 q->subpacket[s].gains2.now = q->subpacket[s].gain_3;
1236 q->subpacket[s].gains2.previous = q->subpacket[s].gain_4;