Lines Matching defs:context
47 ROQDPCMContext *context = avctx->priv_data;
49 av_freep(&context->frame_buffer);
56 ROQDPCMContext *context = avctx->priv_data;
72 context->frame_buffer = av_malloc(8 * ROQ_FRAME_SIZE * avctx->channels *
73 sizeof(*context->frame_buffer));
74 if (!context->frame_buffer) {
79 context->lastSample[0] = context->lastSample[1] = 0;
133 ROQDPCMContext *context = avctx->priv_data;
137 if (!in && context->input_frames >= 8)
140 if (in && context->input_frames < 8) {
141 memcpy(&context->frame_buffer[context->buffered_samples * avctx->channels],
143 context->buffered_samples += avctx->frame_size;
144 if (context->input_frames == 0)
145 context->first_pts = frame->pts;
146 if (context->input_frames < 7) {
147 context->input_frames++;
151 if (context->input_frames < 8) {
152 in = context->frame_buffer;
156 context->lastSample[0] &= 0xFF00;
157 context->lastSample[1] &= 0xFF00;
160 if (context->input_frames == 7)
161 data_size = avctx->channels * context->buffered_samples;
174 bytestream_put_byte(&out, (context->lastSample[1])>>8);
175 bytestream_put_byte(&out, (context->lastSample[0])>>8);
177 bytestream_put_le16(&out, context->lastSample[0]);
181 *out++ = dpcm_predict(&context->lastSample[i & 1], *in++);
183 avpkt->pts = context->input_frames <= 7 ? context->first_pts : frame->pts;
186 context->input_frames++;
188 context->input_frames = FFMAX(context->input_frames, 8);