Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <ffmpegagent-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 22/48] avcodec/mpegvideo: Move unrestricted_mv to MotionEstContext
Date: Mon, 23 Jun 2025 13:36:22 +0000
Message-ID: <a1be77ebdc7a372c0e328c6c3ba3504c16ba2b57.1750685809.git.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.102.ffstaging.FFmpeg.1750685808.ffmpegagent@gmail.com>

From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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".

  parent reply	other threads:[~2025-06-23 13:41 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 13:36 [FFmpeg-devel] [PATCH 00/48] H263DecContext ffmpegagent
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 01/48] avcodec/ituh263dec: Use correct logcontext Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 02/48] avcodec/rl: Avoid branch in index lookup Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 03/48] avcodec/ituh263enc: Simplify creating LUT Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 04/48] avcodec/ituh263dec: Only initialize ff_h263_rl_inter when needed Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 05/48] avcodec/mpegvideoenc: Allocate blocks as part of MPVEncContext Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 06/48] avcodec/mpegvideo: Add MPVContext typedef Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 07/48] avcodec/mpegvideo_dec: Factor debugging dct coefficients out Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 08/48] avcodec/mpegvideo_dec: Reindent after the previous commit Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 09/48] avcodec/mpeg_er: Don't use MpegEncContext.block Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 10/48] avcodec/mpegvideodec: Remove size expectation from ff_mpv_reconstruct_mb Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 11/48] avcodec/h261dec: Stop using MpegEncContext.gb Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 12/48] avcodec/h261dec: Don't use MpegEncContext.block Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 13/48] avcodec/mpeg12dec: Put GetBitContext on the stack where advantageous Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 14/48] avcodec/mpeg12dec: Remove unused function parameter Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 15/48] avcodec/rv34: Don't use MpegEncContext.gb Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 16/48] avcodec/rv34: Don't use MpegEncContext.block Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 17/48] avcodec/intrax8: Don't pretend to need more than one int16_t[64] Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 18/48] avcodec/vc1: Stop using MpegEncContext.gb Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 19/48] avcodec/vc1: Don't use MpegEncContext.block Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 20/48] avcodec/mpeg12dec: Deduplicate variables Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 21/48] avcodec/mpegvideo: Move flipflop_rounding to {MSMPEG4Dec, MPVEnc}Context Andreas Rheinhardt
2025-06-23 13:36 ` Andreas Rheinhardt [this message]
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 23/48] avcodec/mpeg4videodec: Avoid unnecessary indirections Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 24/48] avcodec/{h263, mpeg4video}dec: Pass MPVContext*, not Mpeg4DecContext* Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 25/48] avcodec/mpegvideo: Move dct_precision to Mpeg4DecContext Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 26/48] avcodec/h263dec: Add H263DecContext Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 27/48] avcodec/h263dec: Remove redundant block parameter from decode_mb Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 28/48] avcodec/h263dec: Don't use MpegEncContext.block Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 29/48] avcodec/h263dec: Stop using MpegEncContext.gb Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 30/48] avcodec/mpeg12dec: Add Mpeg12SliceContext Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 31/48] avcodec/mpegvideo: Add missing headers Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 32/48] avcodec/mpeg12dec: Move MpegEncContext.gb to Mpeg12SliceContext Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 33/48] avcodec/mpeg12dec: Don't use MPVContext.block Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 34/48] avcodec/mpegvideo: Move fields only used by H.263 decoders to H263DecCtx Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 35/48] avcodec/mpegvideo: Move mb_num_left to {H263, RV34}DecContext Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 36/48] avcodec/mpeg12dec: Put mb_skip_run on the stack Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 37/48] avcodec/mpegvideo: Move mb_skip_run to {RV34Dec, MPVEnc}Context Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 38/48] avcodec/mpegvideo: Move SLICE_* defs to h263dec.h, h261dec.c Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 39/48] avcodec/msmpeg4dec: Move ff_msmpeg4_decode_init() down Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 40/48] avcodec/h263dec: Use function ptr for decode_picture_header Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 41/48] avcodec/ituh263enc: Inline value of h263_flv Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 42/48] avcodec/flvdec: Binarize h263_flv Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 43/48] avcodec/mpegvideo: Move fields to {H263Dec, MPVEnc}Context when possible Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 44/48] avcodec/mpeg_er: Allow to skip setting partitioned_frame, p[pb]_time Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 45/48] avcodec/mpegvideo: Move partitioned_frame to {H263Dec, MPVEnc}Context Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 46/48] avcodec/mpegvideo: Move loop_filter to {H263Dec, MPVEnc, VC1}Context Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 47/48] avcodec/rv34: Don't report progress unnecessarily Andreas Rheinhardt
2025-06-23 13:36 ` [FFmpeg-devel] [PATCH 48/48] avcodec/rv34: Fix spelling mistake Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1be77ebdc7a372c0e328c6c3ba3504c16ba2b57.1750685809.git.ffmpegagent@gmail.com \
    --to=ffmpegagent-at-gmail.com@ffmpeg.org \
    --cc=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git