Lines Matching defs:avctx

303 static av_cold int mobiclip_init(AVCodecContext *avctx)
306 MobiClipContext *s = avctx->priv_data;
308 if (avctx->width & 15 || avctx->height & 15) {
309 av_log(avctx, AV_LOG_ERROR, "width/height not multiple of 16\n");
315 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
317 s->motion = av_calloc(avctx->width / 16 + 3, sizeof(MotionXY));
320 s->motion_size = (avctx->width / 16 + 3) * sizeof(MotionXY);
333 static int setup_qtables(AVCodecContext *avctx, int64_t quantizer)
335 MobiClipContext *s = avctx->priv_data;
408 static void read_run_encoding(AVCodecContext *avctx,
411 MobiClipContext *s = avctx->priv_data;
421 static int add_coefficients(AVCodecContext *avctx, AVFrame *frame,
424 MobiClipContext *s = avctx->priv_data;
434 read_run_encoding(avctx, &last, &run, &level);
440 read_run_encoding(avctx, &last, &run, &level);
445 read_run_encoding(avctx, &last, &run, &level);
487 static int add_pframe_coefficients(AVCodecContext *avctx, AVFrame *frame,
490 MobiClipContext *s = avctx->priv_data;
495 return add_coefficients(avctx, frame, bx, by, size, plane);
502 ret = add_coefficients(avctx, frame, x, y, 4, plane);
829 static int predict_intra(AVCodecContext *avctx, AVFrame *frame, int ax, int ay,
832 MobiClipContext *s = avctx->priv_data;
834 int w = avctx->width >> !!plane, h = avctx->height >> !!plane;
924 ret = add_coefficients(avctx, frame, ax, ay, size, plane);
929 static int get_prediction(AVCodecContext *avctx, int x, int y, int size)
931 MobiClipContext *s = avctx->priv_data;
951 static int process_block(AVCodecContext *avctx, AVFrame *frame,
954 MobiClipContext *s = avctx->priv_data;
960 pmode = get_prediction(avctx, x, y, 8);
961 return predict_intra(avctx, frame, x, y, pmode, 0, 8, plane);
970 pmode = get_prediction(avctx, x, y, 8);
971 ret = predict_intra(avctx, frame, x, y, pmode, 1, 8, plane);
980 new_pmode = get_prediction(avctx, bx, by, 4);
981 ret = predict_intra(avctx, frame, bx, by, new_pmode, flags & 1, 4, plane);
992 static int decode_macroblock(AVCodecContext *avctx, AVFrame *frame,
995 MobiClipContext *s = avctx->priv_data;
1006 ret = process_block(avctx, frame, x, y, -1, flags & 1, 0);
1010 ret = process_block(avctx, frame, x + 8, y, -1, flags & 1, 0);
1014 ret = process_block(avctx, frame, x, y + 8, -1, flags & 1, 0);
1018 ret = process_block(avctx, frame, x + 8, y + 8, -1, flags & 1, 0);
1026 ret = predict_intra(avctx, frame, x, y, pmode, 0, 16, 0);
1032 ret = process_block(avctx, frame, x, y, pmode, flags & 1, 0);
1036 ret = process_block(avctx, frame, x + 8, y, pmode, flags & 1, 0);
1040 ret = process_block(avctx, frame, x, y + 8, pmode, flags & 1, 0);
1044 ret = process_block(avctx, frame, x + 8, y + 8, pmode, flags & 1, 0);
1052 ret = predict_intra(avctx, frame, x >> 1, y >> 1, pmode_uv, 0, 8, 1 + !s->moflex);
1055 ret = predict_intra(avctx, frame, x >> 1, y >> 1, pmode_uv, 0, 8, 2 - !s->moflex);
1061 ret = process_block(avctx, frame, x >> 1, y >> 1, pmode_uv, flags & 1, 1 + !s->moflex);
1065 ret = process_block(avctx, frame, x >> 1, y >> 1, pmode_uv, flags & 1, 2 - !s->moflex);
1077 static int predict_motion(AVCodecContext *avctx,
1081 MobiClipContext *s = avctx->priv_data;
1084 int fheight = avctx->height;
1085 int fwidth = avctx->width;
1201 ret = predict_motion(avctx, width, height, idx2,
1211 static int mobiclip_decode(AVCodecContext *avctx, AVFrame *rframe,
1214 MobiClipContext *s = avctx->priv_data;
1222 if ((ret = ff_reget_buffer(avctx, frame, 0)) < 0)
1239 ret = setup_qtables(avctx, get_bits(gb, 6));
1243 for (int y = 0; y < avctx->height; y += 16) {
1244 for (int x = 0; x < avctx->width; x += 16) {
1245 ret = decode_macroblock(avctx, frame, x, y, get_bits1(gb));
1259 ret = setup_qtables(avctx, s->quantizer + (int64_t)get_se_golomb(gb));
1263 for (int y = 0; y < avctx->height; y += 16) {
1264 for (int x = 0; x < avctx->width; x += 16) {
1276 ret = decode_macroblock(avctx, frame, x, y, idx == 7);
1281 ret = predict_motion(avctx, 16, 16, idx, x / 16 + 2, x, y);
1292 add_pframe_coefficients(avctx, frame, sx, sy, 8, 0);
1298 add_pframe_coefficients(avctx, frame, x >> 1, y >> 1, 8, 1 + !s->moflex);
1301 add_pframe_coefficients(avctx, frame, x >> 1, y >> 1, 8, 2 - !s->moflex);
1308 avctx->colorspace = AVCOL_SPC_YCGCO;
1319 static void mobiclip_flush(AVCodecContext *avctx)
1321 MobiClipContext *s = avctx->priv_data;
1327 static av_cold int mobiclip_close(AVCodecContext *avctx)
1329 MobiClipContext *s = avctx->priv_data;