Lines Matching refs:subpacket
158 COOKSubpacket subpacket[MAX_SUBPACKETS];
205 if (q->subpacket[i].joint_stereo == 1) {
206 result |= init_vlc(&q->subpacket[i].channel_coupling, 6,
207 (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);
319 ff_free_vlc(&q->subpacket[i].channel_coupling);
846 * First part of subpacket decoding:
883 * Final part of subpacket decoding:
904 * Cook subpacket decoding. This function returns one decoded subpacket,
976 /* estimate subpacket sizes */
977 q->subpacket[0].size = avctx->block_align;
980 q->subpacket[i].size = 2 * buf[avctx->block_align - q->num_subpackets + i];
981 q->subpacket[0].size -= q->subpacket[i].size + 1;
982 if (q->subpacket[0].size < 0) {
984 "frame subpacket size total > avctx->block_align!\n");
991 q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size * 8) >>
992 q->subpacket[i].bits_per_subpdiv;
993 q->subpacket[i].ch_idx = chidx;
995 "subpacket[%i] size %i js %i %i block_align %i\n",
996 i, q->subpacket[i].size, q->subpacket[i].joint_stereo, offset,
999 if ((ret = decode_subpacket(q, &q->subpacket[i], buf + offset, samples)) < 0)
1001 offset += q->subpacket[i].size;
1002 chidx += q->subpacket[i].num_channels;
1003 av_log(avctx, AV_LOG_DEBUG, "subpacket[%i] %i %i\n",
1004 i, q->subpacket[i].size * 8, get_bits_count(&q->gb));
1025 av_dlog(q->avctx, "cookversion=%x\n", q->subpacket[0].cookversion);
1026 if (q->subpacket[0].cookversion > STEREO) {
1027 PRINT("js_subband_start", q->subpacket[0].js_subband_start);
1028 PRINT("js_vlc_bits", q->subpacket[0].js_vlc_bits);
1034 PRINT("samples_per_channel", q->subpacket[0].samples_per_channel);
1035 PRINT("subbands", q->subpacket[0].subbands);
1036 PRINT("js_subband_start", q->subpacket[0].js_subband_start);
1037 PRINT("log2_numvector_size", q->subpacket[0].log2_numvector_size);
1038 PRINT("numvector_size", q->subpacket[0].numvector_size);
1039 PRINT("total_subbands", q->subpacket[0].total_subbands);
1082 q->subpacket[s].cookversion = bytestream_get_be32(&edata_ptr);
1084 q->subpacket[s].subbands = bytestream_get_be16(&edata_ptr);
1089 q->subpacket[s].js_subband_start = bytestream_get_be16(&edata_ptr);
1090 if (q->subpacket[s].js_subband_start >= 51) {
1091 av_log(avctx, AV_LOG_ERROR, "js_subband_start %d is too large\n", q->subpacket[s].js_subband_start);
1095 q->subpacket[s].js_vlc_bits = bytestream_get_be16(&edata_ptr);
1100 q->subpacket[s].samples_per_channel = samples_per_frame / avctx->channels;
1101 q->subpacket[s].bits_per_subpacket = avctx->block_align * 8;
1104 q->subpacket[s].log2_numvector_size = 5;
1105 q->subpacket[s].total_subbands = q->subpacket[s].subbands;
1106 q->subpacket[s].num_channels = 1;
1110 av_log(avctx, AV_LOG_DEBUG, "subpacket[%i].cookversion=%x\n", s,
1111 q->subpacket[s].cookversion);
1112 q->subpacket[s].joint_stereo = 0;
1113 switch (q->subpacket[s].cookversion) {
1123 q->subpacket[s].bits_per_subpdiv = 1;
1124 q->subpacket[s].num_channels = 2;
1135 q->subpacket[s].total_subbands = q->subpacket[s].subbands +
1136 q->subpacket[s].js_subband_start;
1137 q->subpacket[s].joint_stereo = 1;
1138 q->subpacket[s].num_channels = 2;
1140 if (q->subpacket[s].samples_per_channel > 256) {
1141 q->subpacket[s].log2_numvector_size = 6;
1143 if (q->subpacket[s].samples_per_channel > 512) {
1144 q->subpacket[s].log2_numvector_size = 7;
1150 channel_mask |= q->subpacket[s].channel_mask = bytestream_get_be32(&edata_ptr);
1152 if (av_get_channel_layout_nb_channels(q->subpacket[s].channel_mask) > 1) {
1153 q->subpacket[s].total_subbands = q->subpacket[s].subbands +
1154 q->subpacket[s].js_subband_start;
1155 q->subpacket[s].joint_stereo = 1;
1156 q->subpacket[s].num_channels = 2;
1157 q->subpacket[s].samples_per_channel = samples_per_frame >> 1;
1159 if (q->subpacket[s].samples_per_channel > 256) {
1160 q->subpacket[s].log2_numvector_size = 6;
1162 if (q->subpacket[s].samples_per_channel > 512) {
1163 q->subpacket[s].log2_numvector_size = 7;
1166 q->subpacket[s].samples_per_channel = samples_per_frame;
1171 q->subpacket[s].cookversion);
1175 if (s > 1 && q->subpacket[s].samples_per_channel != q->samples_per_channel) {
1179 q->samples_per_channel = q->subpacket[0].samples_per_channel;
1183 q->subpacket[s].numvector_size = (1 << q->subpacket[s].log2_numvector_size);
1186 if (q->subpacket[s].total_subbands > 53) {
1191 if ((q->subpacket[s].js_vlc_bits > 6) ||
1192 (q->subpacket[s].js_vlc_bits < 2 * q->subpacket[s].joint_stereo)) {
1194 q->subpacket[s].js_vlc_bits, 2 * q->subpacket[s].joint_stereo);
1198 if (q->subpacket[s].subbands > 50) {
1202 if (q->subpacket[s].subbands == 0) {
1206 q->subpacket[s].gains1.now = q->subpacket[s].gain_1;
1207 q->subpacket[s].gains1.previous = q->subpacket[s].gain_2;
1208 q->subpacket[s].gains2.now = q->subpacket[s].gain_3;
1209 q->subpacket[s].gains2.previous = q->subpacket[s].gain_4;
1211 if (q->num_subpackets + q->subpacket[s].num_channels > q->avctx->channels) {