diff mbox

[FFmpeg-devel,1/2] avcodec/mpegvideo: Use intra_scantable in dct_unquantize_h263_intra_c()

Message ID 20170619223741.26916-1-michael@niedermayer.cc
State Accepted
Commit 70a7df049c411d9247eb6075720c84196c3e55e8
Headers show

Commit Message

Michael Niedermayer June 19, 2017, 10:37 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/mpegvideo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Kunhya June 20, 2017, 12:06 a.m. UTC | #1
On Tue, 20 Jun 2017, 00:38 Michael Niedermayer, <michael@niedermayer.cc>
wrote:

> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/mpegvideo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 63a30b93ce..e29558b3a2 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -225,7 +225,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext
> *s,
>      if(s->ac_pred)
>          nCoeffs=63;
>      else
> -        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
> +        nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
>
>      for(i=1; i<=nCoeffs; i++) {
>          level = block[i];
> --
> 2.13.0
>

Are you able to document some of this, Ronald and James spent a lot of time
trying to understand this undocumented code and this patch set doesn't
explain anything better.

Kieran

>
James Darnley June 20, 2017, 4:52 p.m. UTC | #2
On 2017-06-20 00:37, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/mpegvideo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 63a30b93ce..e29558b3a2 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -225,7 +225,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext *s,
>      if(s->ac_pred)
>          nCoeffs=63;
>      else
> -        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
> +        nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
>  
>      for(i=1; i<=nCoeffs; i++) {
>          level = block[i];
> 

This copies the change that you pushed for x86.  That change fixed the
issue I had with wmv1.  This must correct that for other platforms.

LGTM.
Michael Niedermayer June 20, 2017, 9:06 p.m. UTC | #3
On Tue, Jun 20, 2017 at 12:06:08AM +0000, Kieran Kunhya wrote:
> On Tue, 20 Jun 2017, 00:38 Michael Niedermayer, <michael@niedermayer.cc>
> wrote:
> 
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/mpegvideo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> > index 63a30b93ce..e29558b3a2 100644
> > --- a/libavcodec/mpegvideo.c
> > +++ b/libavcodec/mpegvideo.c
> > @@ -225,7 +225,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext
> > *s,
> >      if(s->ac_pred)
> >          nCoeffs=63;
> >      else
> > -        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
> > +        nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
> >
> >      for(i=1; i<=nCoeffs; i++) {
> >          level = block[i];
> > --
> > 2.13.0
> >
> 
> Are you able to document some of this, Ronald and James spent a lot of time
> trying to understand this undocumented code and this patch set doesn't
> explain anything better.

can you be more specific about what should be documented ?
Iam a little "handicapped" as i wrote or know large parts of this
stuff, so i do not realize what is hard to understand ...

I think mpegvideo would benefit from some cleanup.
Ideally code should not need documentation in most cases


[...]
Michael Niedermayer June 20, 2017, 9:25 p.m. UTC | #4
On Tue, Jun 20, 2017 at 06:52:09PM +0200, James Darnley wrote:
> On 2017-06-20 00:37, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/mpegvideo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> > index 63a30b93ce..e29558b3a2 100644
> > --- a/libavcodec/mpegvideo.c
> > +++ b/libavcodec/mpegvideo.c
> > @@ -225,7 +225,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext *s,
> >      if(s->ac_pred)
> >          nCoeffs=63;
> >      else
> > -        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
> > +        nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
> >  
> >      for(i=1; i<=nCoeffs; i++) {
> >          level = block[i];
> > 
> 
> This copies the change that you pushed for x86.  That change fixed the
> issue I had with wmv1.  This must correct that for other platforms.

will push this

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 63a30b93ce..e29558b3a2 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -225,7 +225,7 @@  static void dct_unquantize_h263_intra_c(MpegEncContext *s,
     if(s->ac_pred)
         nCoeffs=63;
     else
-        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
+        nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
 
     for(i=1; i<=nCoeffs; i++) {
         level = block[i];