diff mbox series

[FFmpeg-devel,2/6] tools/enc_recon_frame_test: plane 0 height fix

Message ID 20230324002540.3227-2-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/6] avcodec/tests/snowenc: unbreak DWT tests | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch

Commit Message

Michael Niedermayer March 24, 2023, 12:25 a.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tools/enc_recon_frame_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anton Khirnov March 24, 2023, 8:50 a.m. UTC | #1
Quoting Michael Niedermayer (2023-03-24 01:25:36)
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  tools/enc_recon_frame_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/enc_recon_frame_test.c b/tools/enc_recon_frame_test.c
> index 8f09ded47e..1ea2293ee7 100644
> --- a/tools/enc_recon_frame_test.c
> +++ b/tools/enc_recon_frame_test.c
> @@ -83,7 +83,7 @@ static int frame_hash(FrameChecksum **pc, size_t *nb_c, int64_t ts,
>          int linesize = av_image_get_linesize(frame->format, frame->width, p);
>          uint32_t checksum = 0;
>  
> -        for (int j = 0; j < frame->height >> shift_v; j++) {
> +        for (int j = 0; j < frame->height >> (shift_v *!!p); j++) {

IIUC this won't work for alpha. Might as well make it completely
generic.

I'll send an updated version of the tool, thank you for reminding me.
Michael Niedermayer March 24, 2023, 9:30 a.m. UTC | #2
On Fri, Mar 24, 2023 at 09:50:37AM +0100, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2023-03-24 01:25:36)
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  tools/enc_recon_frame_test.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/enc_recon_frame_test.c b/tools/enc_recon_frame_test.c
> > index 8f09ded47e..1ea2293ee7 100644
> > --- a/tools/enc_recon_frame_test.c
> > +++ b/tools/enc_recon_frame_test.c
> > @@ -83,7 +83,7 @@ static int frame_hash(FrameChecksum **pc, size_t *nb_c, int64_t ts,
> >          int linesize = av_image_get_linesize(frame->format, frame->width, p);
> >          uint32_t checksum = 0;
> >  
> > -        for (int j = 0; j < frame->height >> shift_v; j++) {
> > +        for (int j = 0; j < frame->height >> (shift_v *!!p); j++) {
> 
> IIUC this won't work for alpha. Might as well make it completely
> generic.

yes, i didnt really think much about this, it was more a issue i ran into
and wanted to report. After all the tool isnt in git master yet 

> 
> I'll send an updated version of the tool, thank you for reminding me.

[...]

thx
diff mbox series

Patch

diff --git a/tools/enc_recon_frame_test.c b/tools/enc_recon_frame_test.c
index 8f09ded47e..1ea2293ee7 100644
--- a/tools/enc_recon_frame_test.c
+++ b/tools/enc_recon_frame_test.c
@@ -83,7 +83,7 @@  static int frame_hash(FrameChecksum **pc, size_t *nb_c, int64_t ts,
         int linesize = av_image_get_linesize(frame->format, frame->width, p);
         uint32_t checksum = 0;
 
-        for (int j = 0; j < frame->height >> shift_v; j++) {
+        for (int j = 0; j < frame->height >> (shift_v *!!p); j++) {
             checksum = av_adler32_update(checksum, data, linesize);
             data += frame->linesize[p];
         }