Lines Matching defs:avctx
44 static av_cold int cfhd_init(AVCodecContext *avctx)
46 CFHDContext *s = avctx->priv_data;
48 s->avctx = avctx;
247 static int alloc_buffers(AVCodecContext *avctx)
249 CFHDContext *s = avctx->priv_data;
254 if ((ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height)) < 0)
256 avctx->pix_fmt = s->coded_format;
258 ff_cfhddsp_init(&s->dsp, s->bpc, avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16);
376 static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic,
379 CFHDContext *s = avctx->priv_data;
399 av_log(avctx, AV_LOG_DEBUG, "large len %x\n", ((tagu & 0xff) << 16) | data);
401 av_log(avctx, AV_LOG_DEBUG, "Progressive? %"PRIu16"\n", data);
405 av_log(avctx, AV_LOG_DEBUG, "Frame type %"PRIu16"\n", data);
407 av_log(avctx, AV_LOG_DEBUG, "Version major %"PRIu16"\n", data);
409 av_log(avctx, AV_LOG_DEBUG, "Version minor %"PRIu16"\n", data);
411 av_log(avctx, AV_LOG_DEBUG, "Version revision %"PRIu16"\n", data);
413 av_log(avctx, AV_LOG_DEBUG, "Version edit %"PRIu16"\n", data);
415 av_log(avctx, AV_LOG_DEBUG, "Version %"PRIu16"\n", data);
417 av_log(avctx, AV_LOG_DEBUG, "Width %"PRIu16"\n", data);
420 av_log(avctx, AV_LOG_DEBUG, "Height %"PRIu16"\n", data);
423 av_log(avctx, AV_LOG_DEBUG, "Channel Count: %"PRIu16"\n", data);
426 av_log(avctx, AV_LOG_ERROR, "Channel Count of %"PRIu16" is unsupported\n", data);
431 av_log(avctx, AV_LOG_DEBUG, "Subband Count: %"PRIu16"\n", data);
433 av_log(avctx, AV_LOG_ERROR, "Subband Count of %"PRIu16" is unsupported\n", data);
439 av_log(avctx, AV_LOG_DEBUG, "Channel number %"PRIu16"\n", data);
441 av_log(avctx, AV_LOG_ERROR, "Invalid channel number\n");
449 av_log(avctx, AV_LOG_DEBUG, "Subband number %"PRIu16"\n", data);
453 av_log(avctx, AV_LOG_ERROR, "Invalid level\n");
458 av_log(avctx, AV_LOG_ERROR, "Invalid subband number\n");
463 av_log(avctx, AV_LOG_DEBUG, "Subband number actual %"PRIu16"\n", data);
466 av_log(avctx, AV_LOG_ERROR, "Invalid subband number actual\n");
473 av_log(avctx, AV_LOG_WARNING, "Ignoring subband num actual %"PRIu16"\n", data);
475 av_log(avctx, AV_LOG_DEBUG, "Lowpass precision bits: %"PRIu16"\n", data);
478 av_log(avctx, AV_LOG_DEBUG, "Quantisation: %"PRIu16"\n", data);
482 av_log(avctx, AV_LOG_DEBUG, "Prescale table: %x\n", data);
485 av_log(avctx, AV_LOG_ERROR, "Invalid band encoding\n");
490 av_log(avctx, AV_LOG_DEBUG, "Encode Method for Subband %d : %x\n", s->subband_num_actual, data);
492 av_log(avctx, AV_LOG_DEBUG, "Lowpass width %"PRIu16"\n", data);
496 av_log(avctx, AV_LOG_DEBUG, "Lowpass height %"PRIu16"\n", data);
500 av_log(avctx, AV_LOG_DEBUG, "Sample type? %"PRIu16"\n", data);
503 av_log(avctx, AV_LOG_ERROR, "Invalid transform type\n");
507 av_log(avctx, AV_LOG_ERROR, "unsupported transform type\n");
513 av_log(avctx, AV_LOG_DEBUG, "Transform type %"PRIu16"\n", data);
515 av_log(avctx, AV_LOG_DEBUG, "Ignoring additional transform type %"PRIu16"\n", data);
520 av_log(avctx, AV_LOG_DEBUG, "Small chunk length %d %s\n", data * 4, tag < 0 ? "optional" : "required");
523 av_log(avctx, AV_LOG_DEBUG, "Frame index %"PRIu16"\n", data);
526 av_log(avctx, AV_LOG_DEBUG, "Sample index table - skipping %i values\n", data);
528 av_log(avctx, AV_LOG_ERROR, "too many values (%d)\n", data);
534 av_log(avctx, AV_LOG_DEBUG, "Offset = %"PRIu32"\n", offset);
537 av_log(avctx, AV_LOG_DEBUG, "Highpass width %i channel %i level %i subband %i\n", data, s->channel_num, s->level, s->subband_num);
539 av_log(avctx, AV_LOG_ERROR, "Invalid highpass width\n");
546 av_log(avctx, AV_LOG_DEBUG, "Highpass height %i\n", data);
548 av_log(avctx, AV_LOG_ERROR, "Invalid highpass height\n");
554 av_log(avctx, AV_LOG_DEBUG, "Highpass width2 %i\n", data);
556 av_log(avctx, AV_LOG_ERROR, "Invalid highpass width2\n");
563 av_log(avctx, AV_LOG_DEBUG, "Highpass height2 %i\n", data);
565 av_log(avctx, AV_LOG_ERROR, "Invalid highpass height2\n");
571 av_log(avctx, AV_LOG_DEBUG, "Input format %i\n", data);
588 av_log(avctx, AV_LOG_DEBUG, "Other codebook? %i\n", s->codebook);
590 av_log(avctx, AV_LOG_DEBUG, "Precision %i\n", data);
592 av_log(avctx, AV_LOG_ERROR, "Invalid bits per channel\n");
596 avctx->bits_per_raw_sample = s->bpc = data;
598 av_log(avctx, AV_LOG_DEBUG, "Sample format? %i\n", data);
608 avpriv_report_missing_feature(avctx, "Sample format of %"PRIu16, data);
614 av_log(avctx, AV_LOG_DEBUG, "Cropped height %"PRIu16"\n", data);
636 av_log(avctx, AV_LOG_DEBUG, "Unknown tag %i data %x\n", tag, data);
669 if ((ret = alloc_buffers(avctx)) < 0) {
674 ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height);
678 unsigned height = s->cropped_height << (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16);
679 if (avctx->height < height)
681 avctx->height = height;
685 if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
695 if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
723 av_log(avctx, AV_LOG_ERROR, "Invalid lowpass width\n");
730 av_log(avctx, AV_LOG_ERROR, "Invalid lowpass height\n");
736 av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n");
743 av_log(avctx, AV_LOG_ERROR, "Too many lowpass coefficients\n");
748 av_log(avctx, AV_LOG_DEBUG, "Start of lowpass coeffs component %d height:%d, width:%d\n", s->channel_num, lowpass_height, lowpass_width);
768 av_log(avctx, AV_LOG_DEBUG, "Lowpass coefficients %d\n", lowpass_width * lowpass_height);
791 av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n");
797 av_log(avctx, AV_LOG_ERROR, "Too many highpass coefficients\n");
803 av_log(avctx, AV_LOG_DEBUG, "Start subband coeffs plane %i level %i codebook %i expected %i\n", s->channel_num, s->level, s->codebook, expected);
882 av_log(avctx, AV_LOG_ERROR, "Escape codeword not found, probably corrupt data\n");
893 av_log(avctx, AV_LOG_ERROR, "Bitstream overread error\n");
899 av_log(avctx, AV_LOG_DEBUG, "End subband coeffs %i extra %i\n", count, count - expected);
907 s->planes = av_pix_fmt_count_planes(avctx->pix_fmt);
908 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16) {
913 ff_thread_finish_setup(avctx);
918 av_log(avctx, AV_LOG_ERROR, "Invalid dimensions\n");
924 av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n");
956 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16) {
966 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
971 av_log(avctx, AV_LOG_DEBUG, "Decoding level 1 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1007 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1012 av_log(avctx, AV_LOG_DEBUG, "Level 2 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1046 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1051 av_log(avctx, AV_LOG_DEBUG, "Level 3 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1064 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16) {
1073 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16 &&
1074 (lowpass_height * 2 > avctx->coded_height / 2 ||
1075 lowpass_width * 2 > avctx->coded_width / 2 )
1083 if (avctx->pix_fmt == AV_PIX_FMT_GBRAP12 && act_plane == 3)
1090 av_log(avctx, AV_LOG_DEBUG, "interlaced frame ? %d", pic->interlaced_frame);
1113 } else if (s->transform_type == 2 && (avctx->internal->is_copy || s->frame_index == 1 || s->sample_type != 1)) {
1123 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16) {
1133 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1138 av_log(avctx, AV_LOG_DEBUG, "Decoding level 1 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1172 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1177 av_log(avctx, AV_LOG_DEBUG, "Level 2 lowpass plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1220 av_log(avctx, AV_LOG_DEBUG, "temporal level %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1225 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1263 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16) {
1270 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16 &&
1271 (lowpass_height * 2 > avctx->coded_height / 2 ||
1272 lowpass_width * 2 > avctx->coded_width / 2 )
1332 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16) {
1346 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1356 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16) {
1363 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16 &&
1364 (lowpass_height * 2 > avctx->coded_height / 2 ||
1365 lowpass_width * 2 > avctx->coded_width / 2 )
1391 if (avctx->pix_fmt == AV_PIX_FMT_BAYER_RGGB16)
1401 static av_cold int cfhd_close(AVCodecContext *avctx)
1403 CFHDContext *s = avctx->priv_data;