From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 64D694F7F5 for ; Mon, 23 Jun 2025 13:41:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 7E21468E253; Mon, 23 Jun 2025 16:39:00 +0300 (EEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id ADA6D68E267 for ; Mon, 23 Jun 2025 16:38:59 +0300 (EEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2363497cc4dso36811165ad.1 for ; Mon, 23 Jun 2025 06:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750685938; x=1751290738; darn=ffmpeg.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date :references:in-reply-to:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=TnE2B+Ib6ShY9lwIGUrYhDlwwcBtoAmKXhcTpusphb4=; b=M2+bg8lXIF6yYh8KVu0YAC4GtQiFXLiJhSSnzqCk3Sr3ok1apmDPrD+PlHLF0oi/Pz K+sv1/20cqwEhv6lNI18ryU3afm6I/Xk3aXkb4Jrx4E94CXSafyyj2qK0NPlDwf+H0Hp Vi0q0p5HMuW917vvb+UqsaLTD4LsZQdbTp/HChG7Tjhbt8qls9ArWf6wfeYJr1P+7qFi ljiBDMaNGiAC2qYtXx8ljcewwIgafqdISlXwAwqeEizDhlxQf7ZAejQ2t6WG2ICm+X44 Ibdz4EJyGszIBgOkyinYB7t6YH6hMOJd++15oxy92Voqc7yXn65O5FIhYLX88OdzAuMp hLFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750685938; x=1751290738; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date :references:in-reply-to:message-id:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=TnE2B+Ib6ShY9lwIGUrYhDlwwcBtoAmKXhcTpusphb4=; b=FtX9rQd5XgS7G4lfw61P4ld7dDMJxfelhRkx1B1PjyOOm2QTsaVhEKf3OMd/INBonH KRxYih8yMnv2WTr2R1plH2L8N7AfFNa3tn2DAHkNO4xAIfCktjeoylfX32lBifdrsQ/I /cvcPT/bYw9YXyrLqokl+nJBk8sVSA2PsiKKxeZH2dB0Tb/NVuxJTJV9LMH1u5XtbwY9 c16Mn3VVSWy6z9hQcXhJlEcq3CpjL7bGEWyyvhW/ZTXTi9CAaLt29i/pSuNB07wmsSuK RxVE5+C3uwNcreYJK3mmFFttPyE73FP2ZV3CeVDaHmNIvNfkv/9VIi/+UyAzQCKbUW+/ Rl/A== X-Gm-Message-State: AOJu0YzJexkTxOkI2aYcJYiwz91xf5RV1Tje9XyHyDQYI4QvnnO55lIi 3+Rm4iJIETbVMIvEwsjfLQPrQn1UpCmAq/Zn8W0liQIB/URfg44FUix1AlCC5w== X-Gm-Gg: ASbGnct+TLwfy0EKQthx2YMQk6r0to2wxbyGSswspMMgADvPQEAAQRc3Z/9R1deOmQV oFhdHyH+Ht3tapgzvShKU5OB4C1+UnR3oDJ7mYGUDiht8yz2sEv7g9+8iJ32o4Z/82QPD2q0dpj YBonC5NaJjwQqVDj9+K73xPR3p4FRKHSW6WyCCDvC2rn7z3x/xn2Czn54pYcqWstzoYEinj4Swv kEN19nTrqx/XANDN1cFAWPLWfiSMzbFy8m/TU5NbhVQLOJroFFmjZ4AUqevhQmbGitD2Z3E9VbH yzazCEsxFV7t1rfbIQx3bgp7BrRZfoBAQEbYdJeiz3Hx6d5vg9zqJpRKa8ym0e0zHLnCw9X39na HIUgi9PLtgErzWXAr X-Google-Smtp-Source: AGHT+IHHJWNYgyqzhbJo7vkcaxdVJPjQcf+kfmsymDFgulz5d7PW25I6FtI5DP6Da7vkgK3AtHDvEA== X-Received: by 2002:a17:902:c941:b0:233:f3df:513d with SMTP id d9443c01a7336-237d9a78badmr221546875ad.35.1750685937881; Mon, 23 Jun 2025 06:38:57 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-237d873832asm86644975ad.242.2025.06.23.06.38.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2025 06:38:57 -0700 (PDT) From: Andreas Rheinhardt X-Google-Original-From: Andreas Rheinhardt Message-Id: In-Reply-To: References: Date: Mon, 23 Jun 2025 13:36:22 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 22/48] avcodec/mpegvideo: Move unrestricted_mv to MotionEstContext X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Andreas Rheinhardt Signed-off-by: Andreas Rheinhardt --- libavcodec/motion_est.c | 4 ++-- libavcodec/motion_est.h | 1 + libavcodec/mpegvideo.h | 1 - libavcodec/mpegvideo_enc.c | 18 +++++++++--------- libavcodec/rv20enc.c | 2 +- libavcodec/snowenc.c | 2 +- libavcodec/svq1enc.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 333048d1c8..93be712cc0 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -551,7 +551,7 @@ static inline void get_limits(MPVEncContext *const s, int x, int y, int bframe) if(c->avctx->me_range) c->range= c->avctx->me_range >> 1; else c->range= 16; */ - if (s->c.unrestricted_mv) { + if (c->unrestricted_mv) { c->xmin = - x - 16; c->ymin = - y - 16; c->xmax = - x + s->c.width; @@ -600,7 +600,7 @@ static inline int h263_mv4_search(MPVEncContext *const s, int mx, int my, int sh int same=1; const int stride= c->stride; const uint8_t *mv_penalty = c->current_mv_penalty; - int safety_clipping = s->c.unrestricted_mv && (s->c.width&15) && (s->c.height&15); + int safety_clipping = c->unrestricted_mv && (s->c.width&15) && (s->c.height&15); init_mv4_ref(c); diff --git a/libavcodec/motion_est.h b/libavcodec/motion_est.h index 89a2f41b75..7e57a3a79b 100644 --- a/libavcodec/motion_est.h +++ b/libavcodec/motion_est.h @@ -69,6 +69,7 @@ typedef struct MotionEstContext { int mb_flags; int pre_pass; ///< = 1 for the pre pass int dia_size; + int unrestricted_mv; ///< mv can point outside of the coded picture int xmin; int xmax; int ymin; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index a439c1878b..d95cebedd8 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -164,7 +164,6 @@ typedef struct MpegEncContext { int droppable; /* motion compensation */ - int unrestricted_mv; ///< mv can point outside of the coded picture int h263_long_vectors; ///< use horrible H.263v1 long vector mode BlockDSPContext bdsp; diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 8a38e54982..afdc2fb787 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -926,7 +926,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) s->c.h263_aic = (avctx->flags & AV_CODEC_FLAG_AC_PRED) ? 1 : 0; s->c.modified_quant = s->c.h263_aic; s->c.loop_filter = (avctx->flags & AV_CODEC_FLAG_LOOP_FILTER) ? 1 : 0; - s->c.unrestricted_mv = s->c.obmc || s->c.loop_filter || s->c.umvplus; + s->me.unrestricted_mv = s->c.obmc || s->c.loop_filter || s->c.umvplus; s->flipflop_rounding = 1; /* /Fx */ @@ -937,7 +937,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_FLV1: s->c.out_format = FMT_H263; s->c.h263_flv = 2; /* format = 1; 11-bit codes */ - s->c.unrestricted_mv = 1; + s->me.unrestricted_mv = 1; s->rtp_mode = 0; /* don't allow GOB */ avctx->delay = 0; s->c.low_delay = 1; @@ -961,13 +961,13 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) // will be set later on a per-frame basis. s->c.h263_aic = 1; s->c.loop_filter = 1; - s->c.unrestricted_mv = 0; + s->me.unrestricted_mv = 0; break; #endif case AV_CODEC_ID_MPEG4: s->c.out_format = FMT_H263; s->c.h263_pred = 1; - s->c.unrestricted_mv = 1; + s->me.unrestricted_mv = 1; s->flipflop_rounding = 1; s->c.low_delay = m->max_b_frames ? 0 : 1; avctx->delay = s->c.low_delay ? 0 : (m->max_b_frames + 1); @@ -975,7 +975,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_MSMPEG4V2: s->c.out_format = FMT_H263; s->c.h263_pred = 1; - s->c.unrestricted_mv = 1; + s->me.unrestricted_mv = 1; s->c.msmpeg4_version = MSMP4_V2; avctx->delay = 0; s->c.low_delay = 1; @@ -983,7 +983,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_MSMPEG4V3: s->c.out_format = FMT_H263; s->c.h263_pred = 1; - s->c.unrestricted_mv = 1; + s->me.unrestricted_mv = 1; s->c.msmpeg4_version = MSMP4_V3; s->flipflop_rounding = 1; avctx->delay = 0; @@ -992,7 +992,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_WMV1: s->c.out_format = FMT_H263; s->c.h263_pred = 1; - s->c.unrestricted_mv = 1; + s->me.unrestricted_mv = 1; s->c.msmpeg4_version = MSMP4_WMV1; s->flipflop_rounding = 1; avctx->delay = 0; @@ -1001,7 +1001,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_WMV2: s->c.out_format = FMT_H263; s->c.h263_pred = 1; - s->c.unrestricted_mv = 1; + s->me.unrestricted_mv = 1; s->c.msmpeg4_version = MSMP4_WMV2; s->flipflop_rounding = 1; avctx->delay = 0; @@ -1867,7 +1867,7 @@ static void frame_end(MPVMainEncContext *const m) { MPVEncContext *const s = &m->s; - if (s->c.unrestricted_mv && + if (s->me.unrestricted_mv && s->c.cur_pic.reference && !m->intra_only) { int hshift = s->c.chroma_x_shift; diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c index 5c3850c12f..ef2228bb26 100644 --- a/libavcodec/rv20enc.c +++ b/libavcodec/rv20enc.c @@ -51,7 +51,7 @@ int ff_rv20_encode_picture_header(MPVMainEncContext *const m) put_bits(&s->pb, 1, s->c.no_rounding); av_assert1(s->f_code == 1); - av_assert1(!s->c.unrestricted_mv); + av_assert1(!s->me.unrestricted_mv); av_assert1(!s->c.alt_inter_vlc); av_assert1(!s->c.umvplus); av_assert1(s->c.modified_quant == 1); diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 661c6b3c07..68da7f55e7 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1869,7 +1869,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, mpv->me.dia_size = avctx->dia_size; mpv->c.quarter_sample = (s->avctx->flags & AV_CODEC_FLAG_QPEL)!=0; mpv->c.out_format = FMT_H263; - mpv->c.unrestricted_mv = 1; + mpv->me.unrestricted_mv = 1; mpv->lambda = enc->lambda; mpv->c.qscale = (mpv->lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 0816252c2f..ed3dca9025 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -333,7 +333,7 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane, s2->pict_type = s->pict_type; s->m.me.scene_change_score = 0; // s2->out_format = FMT_H263; - // s2->unrestricted_mv = 1; + // s->m.me.unrestricted_mv = 1; s->m.lambda = s->quality; s2->qscale = s->m.lambda * 139 + FF_LAMBDA_SCALE * 64 >> -- ffmpeg-codebot _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".