* [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images
@ 2024-04-08 16:49 Michael Niedermayer
2024-04-08 17:57 ` Paul B Mahol
0 siblings, 1 reply; 4+ messages in thread
From: Michael Niedermayer @ 2024-04-08 16:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: Ticket10952
Fixes: poc21ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/mpegvideo_enc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index d1b19178247..40844b2f682 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1199,8 +1199,8 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
ptrdiff_t dst_stride = i ? s->uvlinesize : s->linesize;
int h_shift = i ? s->chroma_x_shift : 0;
int v_shift = i ? s->chroma_y_shift : 0;
- int w = s->width >> h_shift;
- int h = s->height >> v_shift;
+ 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;
--
2.17.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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images
2024-04-08 16:49 [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images Michael Niedermayer
@ 2024-04-08 17:57 ` Paul B Mahol
2024-04-08 18:00 ` Andreas Rheinhardt
0 siblings, 1 reply; 4+ messages in thread
From: Paul B Mahol @ 2024-04-08 17:57 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Mon, Apr 8, 2024 at 6:49 PM Michael Niedermayer <michael@niedermayer.cc>
wrote:
> Fixes: Ticket10952
> Fixes: poc21ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/mpegvideo_enc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
> index d1b19178247..40844b2f682 100644
> --- a/libavcodec/mpegvideo_enc.c
> +++ b/libavcodec/mpegvideo_enc.c
> @@ -1199,8 +1199,8 @@ static int load_input_picture(MpegEncContext *s,
> const AVFrame *pic_arg)
> ptrdiff_t dst_stride = i ? s->uvlinesize : s->linesize;
> int h_shift = i ? s->chroma_x_shift : 0;
> int v_shift = i ? s->chroma_y_shift : 0;
> - int w = s->width >> h_shift;
> - int h = s->height >> v_shift;
> + 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;
>
What that does? Its not same as aligned rshift macro?
> --
> 2.17.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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images
2024-04-08 17:57 ` Paul B Mahol
@ 2024-04-08 18:00 ` Andreas Rheinhardt
2024-05-06 0:59 ` Michael Niedermayer
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-04-08 18:00 UTC (permalink / raw)
To: ffmpeg-devel
Paul B Mahol:
> On Mon, Apr 8, 2024 at 6:49 PM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
>
>> Fixes: Ticket10952
>> Fixes: poc21ffmpeg
>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
>> ---
>> libavcodec/mpegvideo_enc.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
>> index d1b19178247..40844b2f682 100644
>> --- a/libavcodec/mpegvideo_enc.c
>> +++ b/libavcodec/mpegvideo_enc.c
>> @@ -1199,8 +1199,8 @@ static int load_input_picture(MpegEncContext *s,
>> const AVFrame *pic_arg)
>> ptrdiff_t dst_stride = i ? s->uvlinesize : s->linesize;
>> int h_shift = i ? s->chroma_x_shift : 0;
>> int v_shift = i ? s->chroma_y_shift : 0;
>> - int w = s->width >> h_shift;
>> - int h = s->height >> v_shift;
>> + 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;
>>
>
> What that does? Its not same as aligned rshift macro?
>
It is the same, just more complicated. And maybe with more instructions.
- Andreas
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images
2024-04-08 18:00 ` Andreas Rheinhardt
@ 2024-05-06 0:59 ` Michael Niedermayer
0 siblings, 0 replies; 4+ messages in thread
From: Michael Niedermayer @ 2024-05-06 0:59 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1804 bytes --]
On Mon, Apr 08, 2024 at 08:00:58PM +0200, Andreas Rheinhardt wrote:
> Paul B Mahol:
> > On Mon, Apr 8, 2024 at 6:49 PM Michael Niedermayer <michael@niedermayer.cc>
> > wrote:
> >
> >> Fixes: Ticket10952
> >> Fixes: poc21ffmpeg
> >> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> >> ---
> >> libavcodec/mpegvideo_enc.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
> >> index d1b19178247..40844b2f682 100644
> >> --- a/libavcodec/mpegvideo_enc.c
> >> +++ b/libavcodec/mpegvideo_enc.c
> >> @@ -1199,8 +1199,8 @@ static int load_input_picture(MpegEncContext *s,
> >> const AVFrame *pic_arg)
> >> ptrdiff_t dst_stride = i ? s->uvlinesize : s->linesize;
> >> int h_shift = i ? s->chroma_x_shift : 0;
> >> int v_shift = i ? s->chroma_y_shift : 0;
> >> - int w = s->width >> h_shift;
> >> - int h = s->height >> v_shift;
> >> + 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;
> >>
> >
> > What that does? Its not same as aligned rshift macro?
> >
>
> It is the same, just more complicated. And maybe with more instructions.
will apply with "aligned rshift" macro
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-06 0:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08 16:49 [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Fix 1 line and one column images Michael Niedermayer
2024-04-08 17:57 ` Paul B Mahol
2024-04-08 18:00 ` Andreas Rheinhardt
2024-05-06 0:59 ` Michael Niedermayer
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