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 <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 03/13] avcodec/mpegvideo_enc: Reindentation
Date: Fri,  6 Oct 2023 04:46:26 +0200
Message-ID: <AS8P250MB0744CDEEBA6587D8005105758FC9A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB074414A7969C8EDBBF6EA09E8FC9A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegvideo_enc.c | 84 +++++++++++++++++++-------------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 3be6c1f928..09b8348ae7 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1171,50 +1171,50 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
             return ret;
 
         if (!direct) {
-                int h_chroma_shift, v_chroma_shift;
-                av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
-                                                 &h_chroma_shift,
-                                                 &v_chroma_shift);
-
-                for (i = 0; i < 3; i++) {
-                    int src_stride = pic_arg->linesize[i];
-                    int dst_stride = i ? s->uvlinesize : s->linesize;
-                    int h_shift = i ? h_chroma_shift : 0;
-                    int v_shift = i ? v_chroma_shift : 0;
-                    int w = s->width  >> h_shift;
-                    int h = s->height >> v_shift;
-                    const uint8_t *src = pic_arg->data[i];
-                    uint8_t *dst = pic->f->data[i];
-                    int vpad = 16;
-
-                    if (   s->codec_id == AV_CODEC_ID_MPEG2VIDEO
-                        && !s->progressive_sequence
-                        && FFALIGN(s->height, 32) - s->height > 16)
-                        vpad = 32;
-
-                    if (!s->avctx->rc_buffer_size)
-                        dst += INPLACE_OFFSET;
-
-                    if (src_stride == dst_stride)
-                        memcpy(dst, src, src_stride * h);
-                    else {
-                        int h2 = h;
-                        uint8_t *dst2 = dst;
-                        while (h2--) {
-                            memcpy(dst2, src, w);
-                            dst2 += dst_stride;
-                            src += src_stride;
-                        }
-                    }
-                    if ((s->width & 15) || (s->height & (vpad-1))) {
-                        s->mpvencdsp.draw_edges(dst, dst_stride,
-                                                w, h,
-                                                16 >> h_shift,
-                                                vpad >> v_shift,
-                                                EDGE_BOTTOM);
+            int h_chroma_shift, v_chroma_shift;
+            av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
+                                             &h_chroma_shift,
+                                             &v_chroma_shift);
+
+            for (int i = 0; i < 3; i++) {
+                int src_stride = pic_arg->linesize[i];
+                int dst_stride = i ? s->uvlinesize : s->linesize;
+                int h_shift = i ? h_chroma_shift : 0;
+                int v_shift = i ? v_chroma_shift : 0;
+                int w = s->width  >> h_shift;
+                int h = s->height >> v_shift;
+                const uint8_t *src = pic_arg->data[i];
+                uint8_t *dst = pic->f->data[i];
+                int vpad = 16;
+
+                if (   s->codec_id == AV_CODEC_ID_MPEG2VIDEO
+                    && !s->progressive_sequence
+                    && FFALIGN(s->height, 32) - s->height > 16)
+                    vpad = 32;
+
+                if (!s->avctx->rc_buffer_size)
+                    dst += INPLACE_OFFSET;
+
+                if (src_stride == dst_stride)
+                    memcpy(dst, src, src_stride * h);
+                else {
+                    int h2 = h;
+                    uint8_t *dst2 = dst;
+                    while (h2--) {
+                        memcpy(dst2, src, w);
+                        dst2 += dst_stride;
+                        src += src_stride;
                     }
                 }
-                emms_c();
+                if ((s->width & 15) || (s->height & (vpad-1))) {
+                    s->mpvencdsp.draw_edges(dst, dst_stride,
+                                            w, h,
+                                            16 >> h_shift,
+                                            vpad >> v_shift,
+                                            EDGE_BOTTOM);
+                }
+            }
+            emms_c();
         }
         ret = av_frame_copy_props(pic->f, pic_arg);
         if (ret < 0) {
-- 
2.34.1

_______________________________________________
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:[~2023-10-06  2:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06  2:38 [FFmpeg-devel] [PATCH 01/13] avcodec/mpegvideo_enc: Fix abort on allocation errors Andreas Rheinhardt
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 02/13] avcodec/mpegvideo_enc: Remove always-false checks Andreas Rheinhardt
2023-10-06  2:46 ` Andreas Rheinhardt [this message]
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 04/13] avcodec/mpegvideo_enc: Don't pretend input to be non-refcounted Andreas Rheinhardt
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 05/13] avcodec/mpegvideo_enc: Don't reget known values Andreas Rheinhardt
2023-10-08 16:51   ` Michael Niedermayer
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 06/13] avcodec/mpegvideo_enc: Don't overallocate arrays Andreas Rheinhardt
2023-10-07 16:33   ` Michael Niedermayer
2023-10-07 17:28     ` Andreas Rheinhardt
2023-10-09 12:30       ` Andreas Rheinhardt
2023-10-09 17:17         ` Michael Niedermayer
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 07/13] avcodec/mpegvideo_enc: Don't set write-only properties Andreas Rheinhardt
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 08/13] avcodec/mpegvideo_enc: Remove dead block Andreas Rheinhardt
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 09/13] avcodec/mpegvideo_enc: Don't allocate buffers unnecessarily Andreas Rheinhardt
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 10/13] avcodec/mpegvideo_enc: Don't call av_frame_copy_props() unnecessarily Andreas Rheinhardt
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 11/13] avcodec/mpegpicture: Move caller-specific parts of function to callers Andreas Rheinhardt
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 12/13] avcodec/mpeg(picture|video_dec): Move comment to more appropriate place Andreas Rheinhardt
2023-10-08 16:48   ` Michael Niedermayer
2023-10-06  2:46 ` [FFmpeg-devel] [PATCH 13/13] avcodec/vdpau_vc1: Fix indentation 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=AS8P250MB0744CDEEBA6587D8005105758FC9A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
    --to=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