• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavcodec/

Lines Matching defs:bd

564 static int read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
570 if (bd->block_length <= 0)
573 *bd->raw_samples = 0;
574 *bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
575 bd->js_blocks = get_bits1(gb);
580 if (*bd->const_block) {
582 *bd->raw_samples = get_sbits_long(gb, const_val_bits);
586 *bd->const_block = 1;
594 static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
596 int smp = bd->block_length - 1;
597 int32_t val = *bd->raw_samples;
598 int32_t *dst = bd->raw_samples + 1;
608 static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
620 int32_t *quant_cof = bd->quant_cof;
625 *bd->const_block = 0;
627 *bd->opt_order = 1;
628 bd->js_blocks = get_bits1(gb);
630 opt_order = *bd->opt_order;
646 if (bd->block_length & (sub_blocks - 1)) {
652 sb_length = bd->block_length >> log2_sub_blocks;
675 *bd->shift_lsbs = get_bits(gb, 4) + 1;
677 *bd->store_prev_samples = (bd->js_blocks && bd->raw_other) || *bd->shift_lsbs;
682 int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
684 *bd->opt_order = get_bits(gb, opt_order_length);
685 if (*bd->opt_order > sconf->max_order) {
686 *bd->opt_order = sconf->max_order;
691 *bd->opt_order = sconf->max_order;
693 if (*bd->opt_order > bd->block_length) {
694 *bd->opt_order = bd->block_length;
698 opt_order = *bd->opt_order;
756 *bd->use_ltp = get_bits1(gb);
758 if (*bd->use_ltp) {
761 bd->ltp_gain[0] = decode_rice(gb, 1) << 3;
762 bd->ltp_gain[1] = decode_rice(gb, 2) << 3;
766 bd->ltp_gain[2] = ltp_gain_values[r][c];
768 bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
769 bd->ltp_gain[4] = decode_rice(gb, 1) << 3;
771 *bd->ltp_lag = get_bits(gb, ctx->ltp_lag_length);
772 *bd->ltp_lag += FFMAX(4, opt_order + 1);
777 if (bd->ra_block) {
779 bd->raw_samples[0] = decode_rice(gb, avctx->bits_per_raw_sample - 4);
781 bd->raw_samples[1] = decode_rice(gb, FFMIN(s[0] + 3, ctx->s_max));
783 bd->raw_samples[2] = decode_rice(gb, FFMIN(s[0] + 1, ctx->s_max));
792 unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5);
801 current_res = bd->raw_samples + start;
819 current_res = bd->raw_samples + start;
859 current_res = bd->raw_samples + start;
875 static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
878 unsigned int block_length = bd->block_length;
881 int opt_order = *bd->opt_order;
884 int32_t *quant_cof = bd->quant_cof;
885 int32_t *lpc_cof = bd->lpc_cof;
886 int32_t *raw_samples = bd->raw_samples;
887 int32_t *raw_samples_end = bd->raw_samples + bd->block_length;
891 if (*bd->use_ltp) {
894 for (ltp_smp = FFMAX(*bd->ltp_lag - 2, 0); ltp_smp < block_length; ltp_smp++) {
895 int center = ltp_smp - *bd->ltp_lag;
904 y += MUL64(bd->ltp_gain[tab], raw_samples[base]);
911 if (bd->ra_block) {
926 if (*bd->store_prev_samples)
927 memcpy(bd->prev_raw_samples, raw_samples - sconf->max_order,
928 sizeof(*bd->prev_raw_samples) * sconf->max_order);
931 if (bd->js_blocks && bd->raw_other) {
934 if (bd->raw_other > raw_samples) { // D = R - L
936 right = bd->raw_other;
938 left = bd->raw_other;
947 if (*bd->shift_lsbs)
949 raw_samples[sb] >>= *bd->shift_lsbs;
959 raw_samples = bd->raw_samples + smp;
971 raw_samples = bd->raw_samples;
974 if (*bd->store_prev_samples)
975 memcpy(raw_samples - sconf->max_order, bd->prev_raw_samples,
984 static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
989 *bd->shift_lsbs = 0;
992 ret = read_var_block_data(ctx, bd);
994 ret = read_const_block_data(ctx, bd);
1003 static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
1009 if (*bd->const_block)
1010 decode_const_block_data(ctx, bd);
1012 ret = decode_var_block_data(ctx, bd); // always return 0
1019 if (*bd->shift_lsbs)
1020 for (smp = 0; smp < bd->block_length; smp++)
1021 bd->raw_samples[smp] <<= *bd->shift_lsbs;
1029 static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)
1033 if ((ret = read_block(ctx, bd)) < 0)
1036 return decode_block(ctx, bd);
1064 ALSBlockData bd = { 0 };
1066 bd.ra_block = ra_frame;
1067 bd.const_block = ctx->const_block;
1068 bd.shift_lsbs = ctx->shift_lsbs;
1069 bd.opt_order = ctx->opt_order;
1070 bd.store_prev_samples = ctx->store_prev_samples;
1071 bd.use_ltp = ctx->use_ltp;
1072 bd.ltp_lag = ctx->ltp_lag;
1073 bd.ltp_gain = ctx->ltp_gain[0];
1074 bd.quant_cof = ctx->quant_cof[0];
1075 bd.lpc_cof = ctx->lpc_cof[0];
1076 bd.prev_raw_samples = ctx->prev_raw_samples;
1077 bd.raw_samples = ctx->raw_samples[c];
1081 bd.block_length = div_blocks[b];
1083 if ((ret = read_decode_block(ctx, &bd)) < 0) {
1085 zero_remaining(b, ctx->num_blocks, div_blocks, bd.raw_samples);
1088 bd.raw_samples += div_blocks[b];
1089 bd.ra_block = 0;
1106 ALSBlockData bd[2] = { { 0 } };
1108 bd[0].ra_block = ra_frame;
1109 bd[0].const_block = ctx->const_block;
1110 bd[0].shift_lsbs = ctx->shift_lsbs;
1111 bd[0].opt_order = ctx->opt_order;
1112 bd[0].store_prev_samples = ctx->store_prev_samples;
1113 bd[0].use_ltp = ctx->use_ltp;
1114 bd[0].ltp_lag = ctx->ltp_lag;
1115 bd[0].ltp_gain = ctx->ltp_gain[0];
1116 bd[0].quant_cof = ctx->quant_cof[0];
1117 bd[0].lpc_cof = ctx->lpc_cof[0];
1118 bd[0].prev_raw_samples = ctx->prev_raw_samples;
1119 bd[0].js_blocks = *js_blocks;
1121 bd[1].ra_block = ra_frame;
1122 bd[1].const_block = ctx->const_block;
1123 bd[1].shift_lsbs = ctx->shift_lsbs;
1124 bd[1].opt_order = ctx->opt_order;
1125 bd[1].store_prev_samples = ctx->store_prev_samples;
1126 bd[1].use_ltp = ctx->use_ltp;
1127 bd[1].ltp_lag = ctx->ltp_lag;
1128 bd[1].ltp_gain = ctx->ltp_gain[0];
1129 bd[1].quant_cof = ctx->quant_cof[0];
1130 bd[1].lpc_cof = ctx->lpc_cof[0];
1131 bd[1].prev_raw_samples = ctx->prev_raw_samples;
1132 bd[1].js_blocks = *(js_blocks + 1);
1138 bd[0].block_length = div_blocks[b];
1139 bd[1].block_length = div_blocks[b];
1141 bd[0].raw_samples = ctx->raw_samples[c ] + offset;
1142 bd[1].raw_samples = ctx->raw_samples[c + 1] + offset;
1144 bd[0].raw_other = bd[1].raw_samples;
1145 bd[1].raw_other = bd[0].raw_samples;
1147 if ((ret = read_decode_block(ctx, &bd[0])) < 0 ||
1148 (ret = read_decode_block(ctx, &bd[1])) < 0)
1152 if (bd[0].js_blocks) {
1153 if (bd[1].js_blocks)
1157 bd[0].raw_samples[s] = bd[1].raw_samples[s] - bd[0].raw_samples[s];
1158 } else if (bd[1].js_blocks) {
1160 bd[1].raw_samples[s] = bd[1].raw_samples[s] + bd[0].raw_samples[s];
1164 bd[0].ra_block = 0;
1165 bd[1].ra_block = 0;
1177 zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples);
1178 zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples);
1238 static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
1252 revert_channel_correlation(ctx, bd, cd, reverted, offset,
1263 bd->const_block = ctx->const_block + c;
1264 bd->shift_lsbs = ctx->shift_lsbs + c;
1265 bd->opt_order = ctx->opt_order + c;
1266 bd->store_prev_samples = ctx->store_prev_samples + c;
1267 bd->use_ltp = ctx->use_ltp + c;
1268 bd->ltp_lag = ctx->ltp_lag + c;
1269 bd->ltp_gain = ctx->ltp_gain[c];
1270 bd->lpc_cof = ctx->lpc_cof[c];
1271 bd->quant_cof = ctx->quant_cof[c];
1272 bd->raw_samples = ctx->raw_samples[c] + offset;
1277 unsigned int end = bd->block_length - 1;
1303 bd->raw_samples[smp] += y >> 7;
1312 bd->raw_samples[smp] += y >> 7;
1382 ALSBlockData bd = { 0 };
1395 bd.ra_block = ra_frame;
1396 bd.prev_raw_samples = ctx->prev_raw_samples;
1401 bd.block_length = div_blocks[b];
1402 if (bd.block_length <= 0) {
1405 bd.block_length);
1410 bd.const_block = ctx->const_block + c;
1411 bd.shift_lsbs = ctx->shift_lsbs + c;
1412 bd.opt_order = ctx->opt_order + c;
1413 bd.store_prev_samples = ctx->store_prev_samples + c;
1414 bd.use_ltp = ctx->use_ltp + c;
1415 bd.ltp_lag = ctx->ltp_lag + c;
1416 bd.ltp_gain = ctx->ltp_gain[c];
1417 bd.lpc_cof = ctx->lpc_cof[c];
1418 bd.quant_cof = ctx->quant_cof[c];
1419 bd.raw_samples = ctx->raw_samples[c] + offset;
1420 bd.raw_other = NULL;
1422 if ((ret = read_block(ctx, &bd)) < 0)
1429 ret = revert_channel_correlation(ctx, &bd, ctx->chan_data,
1435 bd.const_block = ctx->const_block + c;
1436 bd.shift_lsbs = ctx->shift_lsbs + c;
1437 bd.opt_order = ctx->opt_order + c;
1438 bd.store_prev_samples = ctx->store_prev_samples + c;
1439 bd.use_ltp = ctx->use_ltp + c;
1440 bd.ltp_lag = ctx->ltp_lag + c;
1441 bd.ltp_gain = ctx->ltp_gain[c];
1442 bd.lpc_cof = ctx->lpc_cof[c];
1443 bd.quant_cof = ctx->quant_cof[c];
1444 bd.raw_samples = ctx->raw_samples[c] + offset;
1446 if ((ret = decode_block(ctx, &bd)) < 0)
1452 bd.ra_block = 0;