Lines Matching defs:avctx
40 static av_cold int decode_init(AVCodecContext *avctx)
42 V210DecContext *s = avctx->priv_data;
44 avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
45 avctx->bits_per_raw_sample = 10;
47 s->thread_count = av_clip(avctx->thread_count, 1, avctx->height/4);
106 static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
108 V210DecContext *s = avctx->priv_data;
112 int slice_start = (avctx->height * jobnr) / s->thread_count;
113 int slice_end = (avctx->height * (jobnr+1)) / s->thread_count;
120 decode_row((const uint32_t *)psrc, py, pu, pv, avctx->width, s->unpack_frame);
135 static int decode_frame(AVCodecContext *avctx, AVFrame *pic,
138 V210DecContext *s = avctx->priv_data;
146 stride = v210_stride(avctx->width, 48);
147 if (avpkt->size < stride * avctx->height) {
150 int small_stride = v210_stride(avctx->width, align);
151 if (avpkt->size == small_stride * avctx->height) {
154 av_log(avctx, AV_LOG_WARNING, "Broken v210 with too small padding (%d byte) detected\n", align * 8 / 3);
159 if (align < 6 && avctx->codec_tag == MKTAG('b', 'x', 'y', '2'))
164 if (stride == 0 && ((avctx->width & 1) || (int64_t)avctx->width * avctx->height > INT_MAX / 6)) {
165 av_log(avctx, AV_LOG_ERROR, "Strideless v210 is not supported for size %dx%d\n", avctx->width, avctx->height);
169 if (stride > 0 && avpkt->size < (int64_t)stride * avctx->height ||
170 stride == 0 && avpkt->size < v210_stride(avctx->width * avctx->height, 6)) {
171 av_log(avctx, AV_LOG_ERROR, "packet too small\n");
174 if ( avctx->codec_tag == MKTAG('C', '2', '1', '0')
177 && avpkt->size - 64 >= stride * avctx->height)
186 if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
196 avctx->execute2(avctx, v210_decode_slice, &td, NULL, s->thread_count);
200 int ret = av_image_alloc(pointers, linesizes, avctx->width, avctx->height, avctx->pix_fmt, 1);
203 decode_row((const uint32_t *)psrc, (uint16_t *)pointers[0], (uint16_t *)pointers[1], (uint16_t *)pointers[2], avctx->width * avctx->height, s->unpack_frame);
204 av_image_copy(pic->data, pic->linesize, (const uint8_t **)pointers, linesizes, avctx->pix_fmt, avctx->width, avctx->height);
208 if (avctx->field_order > AV_FIELD_PROGRESSIVE) {
211 if (avctx->field_order == AV_FIELD_TT || avctx->field_order == AV_FIELD_TB)