Lines Matching defs:frame
58 SilkFrame frame[2];
305 static inline void silk_decode_lpc(SilkContext *s, SilkFrame *frame,
378 if (offset != 4 && frame->coded) {
383 nlsf_leadin[i] = frame->nlsf[i] +
384 ((nlsf[i] - frame->nlsf[i]) * offset >> 2);
387 memcpy(lpc_leadin, frame->lpc, 16 * sizeof(float));
398 memcpy(frame->nlsf, nlsf, order * sizeof(nlsf[0]));
399 memcpy(frame->lpc, lpc, order * sizeof(lpc[0]));
513 /* per frame */
528 SilkFrame * const frame = s->frame + channel;
553 /* obtain frame type */
568 if (i == 0 && (frame_num == 0 || !frame->coded)) {
573 if (frame->coded)
574 log_gain = FFMAX(log_gain, frame->log_gain - 16);
579 frame->log_gain + delta_gain - 4), 6);
582 frame->log_gain = log_gain;
593 silk_decode_lpc(s, frame, rc, lpc_leadin, lpc_body, &order, &has_lpc_leadin, voiced);
595 /* obtain pitch lags, if this is a voiced frame */
597 int lag_absolute = (!frame_num || !frame->prev_voiced);
598 int primarylag; // primary pitch lag for the entire SILK frame
605 primarylag = frame->primarylag + delta - 9;
623 frame->primarylag = primarylag;
666 /* generate the excitation signal for the entire frame */
678 float *dst = frame->output + SILK_HISTORY + i * s->sflength;
680 float *lpc = frame->lpc_history + SILK_HISTORY + i * s->sflength;
731 frame->prev_voiced = voiced;
732 memmove(frame->lpc_history, frame->lpc_history + s->flength, SILK_HISTORY * sizeof(float));
733 memmove(frame->output, frame->output + s->flength, SILK_HISTORY * sizeof(float));
735 frame->coded = 1;
740 float *mid = s->frame[0].output + SILK_HISTORY - s->flength;
741 float *side = s->frame[1].output + SILK_HISTORY - s->flength;
768 static void silk_flush_frame(SilkFrame *frame)
770 if (!frame->coded)
773 memset(frame->output, 0, sizeof(frame->output));
774 memset(frame->lpc_history, 0, sizeof(frame->lpc_history));
776 memset(frame->lpc, 0, sizeof(frame->lpc));
777 memset(frame->nlsf, 0, sizeof(frame->nlsf));
779 frame->log_gain = 0;
781 frame->primarylag = 0;
782 frame->prev_voiced = 0;
783 frame->coded = 0;
811 silk_flush_frame(&s->frame[1]);
822 /* read the per-frame LBRR flags */
843 if (s->midonly && s->frame[1].coded)
844 silk_flush_frame(&s->frame[1]);
849 s->frame[0].output + SILK_HISTORY - s->flength - 2,
869 silk_flush_frame(&s->frame[0]);
870 silk_flush_frame(&s->frame[1]);