• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching refs:avctx

306 static av_cold int g726_encode_init(AVCodecContext *avctx)
308 G726Context* c = avctx->priv_data;
310 if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL &&
311 avctx->sample_rate != 8000) {
312 av_log(avctx, AV_LOG_ERROR, "Sample rates other than 8kHz are not "
317 av_assert0(avctx->sample_rate > 0);
319 if(avctx->channels != 1){
320 av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
324 if (avctx->bit_rate)
325 c->code_size = (avctx->bit_rate + avctx->sample_rate/2) / avctx->sample_rate;
328 avctx->bit_rate = c->code_size * avctx->sample_rate;
329 avctx->bits_per_coded_sample = c->code_size;
333 avctx->coded_frame = avcodec_alloc_frame();
334 if (!avctx->coded_frame)
336 avctx->coded_frame->key_frame = 1;
340 avctx->frame_size = ((int[]){ 4096, 2736, 2048, 1640 })[c->code_size - 2];
345 static av_cold int g726_encode_close(AVCodecContext *avctx)
347 av_freep(&avctx->coded_frame);
351 static int g726_encode_frame(AVCodecContext *avctx,
354 G726Context *c = avctx->priv_data;
361 for (i = 0; i < avctx->frame_size; i++)
405 static av_cold int g726_decode_init(AVCodecContext *avctx)
407 G726Context* c = avctx->priv_data;
409 if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT &&
410 avctx->sample_rate != 8000) {
411 av_log(avctx, AV_LOG_ERROR, "Only 8kHz sample rate is allowed when "
417 if(avctx->channels != 1){
418 av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
422 c->code_size = avctx->bits_per_coded_sample;
424 av_log(avctx, AV_LOG_ERROR, "Invalid number of bits %d\n", c->code_size);
429 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
432 avctx->coded_frame = &c->frame;
437 static int g726_decode_frame(AVCodecContext *avctx, void *data,
442 G726Context *c = avctx->priv_data;
451 if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
452 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
463 av_log(avctx, AV_LOG_ERROR, "Frame invalidly split, missing parser?\n");
471 static void g726_decode_flush(AVCodecContext *avctx)
473 G726Context *c = avctx->priv_data;