| 84 | H264_CHROMA_MC(avg_, op_avg) |
| 85 | |
| 86 | av_cold int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) |
| 87 | { |
| 88 | enum ThreadingStatus thread_status; |
| 89 | |
| 90 | ff_mpv_common_defaults(s); |
| 91 | |
| 92 | s->avctx = avctx; |
| 93 | s->width = avctx->coded_width; |
| 94 | s->height = avctx->coded_height; |
| 95 | s->codec_id = avctx->codec->id; |
| 96 | s->workaround_bugs = avctx->workaround_bugs; |
| 97 | |
| 98 | /* convert fourcc to upper case */ |
| 99 | s->codec_tag = ff_toupper4(avctx->codec_tag); |
| 100 | |
| 101 | ff_mpv_idct_init(s); |
| 102 | |
| 103 | ff_h264chroma_init(&s->h264chroma, 8); //for lowres |
| 104 | s->h264chroma.avg_h264_chroma_pixels_tab[3] = avg_h264_chroma_mc1; |
| 105 | s->h264chroma.put_h264_chroma_pixels_tab[3] = put_h264_chroma_mc1; |
| 106 | |
| 107 | if (s->picture_pool) // VC-1 can call this multiple times |
| 108 | return 0; |
| 109 | |
| 110 | thread_status = ff_thread_sync_ref(avctx, offsetof(MpegEncContext, picture_pool)); |
| 111 | if (thread_status != FF_THREAD_IS_COPY) { |
| 112 | s->picture_pool = ff_mpv_alloc_pic_pool(thread_status != FF_THREAD_NO_FRAME_THREADING); |
| 113 | if (!s->picture_pool) |
| 114 | return AVERROR(ENOMEM); |
| 115 | } |
| 116 | return 0; |
| 117 | } |
| 118 | |
| 119 | int ff_mpeg_update_thread_context(AVCodecContext *dst, |
| 120 | const AVCodecContext *src) |
no test coverage detected