Lines Matching refs:img
63 static void image_copy_16_to_8(AVFrame *pic, struct aom_image *img)
69 int w = img->d_w;
70 int h = img->d_h;
74 w = (w + img->x_chroma_shift) >> img->x_chroma_shift;
75 h = (h + img->y_chroma_shift) >> img->y_chroma_shift;
79 uint16_t *src = (uint16_t *)(img->planes[i] + y * img->stride[i]);
88 static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
93 avctx->color_range = color_ranges[img->range];
94 avctx->color_primaries = img->cp;
95 avctx->colorspace = img->mc;
96 avctx->color_trc = img->tc;
98 switch (img->fmt) {
101 if (img->bit_depth == 8) {
102 avctx->pix_fmt = img->monochrome ?
106 } else if (img->bit_depth == 10) {
107 avctx->pix_fmt = img->monochrome ?
111 } else if (img->bit_depth == 12) {
112 avctx->pix_fmt = img->monochrome ?
121 if (img->bit_depth == 8) {
125 } else if (img->bit_depth == 10) {
129 } else if (img->bit_depth == 12) {
138 if (img->bit_depth == 8) {
142 } else if (img->bit_depth == 10) {
146 } else if (img->bit_depth == 12) {
164 struct aom_image *img;
179 if ((img = aom_codec_get_frame(&ctx->decoder, &iter))) {
180 if (img->d_w > img->w || img->d_h > img->h) {
182 img->d_w, img->d_h, img->w, img->h);
186 if ((ret = set_pix_fmt(avctx, img)) < 0) {
188 img->fmt, img->bit_depth);
192 if ((int)img->d_w != avctx->width || (int)img->d_h != avctx->height) {
194 avctx->width, avctx->height, img->d_w, img->d_h);
195 ret = ff_set_dimensions(avctx, img->d_w, img->d_h);
220 picture->height * img->r_w,
221 picture->width * img->r_h,
225 if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8)
226 image_copy_16_to_8(picture, img);
228 const uint8_t *planes[4] = { img->planes[0], img->planes[1], img->planes[2] };
229 const int stride[4] = { img->stride[0], img->stride[1], img->stride[2] };
232 stride, avctx->pix_fmt, img->d_w, img->d_h);