[FFmpeg-devel] [PATCH 4/4] libavcodec/jpeg2000dec: Support for PPM marker

Gautam Ramakrishnan gautamramk at gmail.com
Tue Jul 14 07:10:06 EEST 2020


On Tue, Jul 14, 2020 at 2:57 AM Michael Niedermayer
<michael at niedermayer.cc> wrote:
>
> On Mon, Jul 13, 2020 at 10:50:02PM +0530, gautamramk at gmail.com wrote:
> > From: Gautam Ramakrishnan <gautamramk at gmail.com>
> >
> > This patch adds support for PPM marker for JPEG2000
> > decoder. It allows the samples p1_03.j2k and p1_05.j2k
> > to be decoded.
> > ---
> >  libavcodec/jpeg2000dec.c | 107 +++++++++++++++++++++++++++++++++++----
> >  1 file changed, 97 insertions(+), 10 deletions(-)
> [...]
>
> > @@ -2189,8 +2266,18 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
> >              // Packet length, tile-part header
> >              ret = get_plt(s, len);
> >              break;
> > +        case JPEG2000_PPM:
> > +            // Packed headers, main header
> > +            ret = get_ppm(s, len);
> > +            break;
> >          case JPEG2000_PPT:
> >              // Packed headers, tile-part header
> > +            if (s->has_ppm) {
> > +                av_log(s->avctx, AV_LOG_ERROR,
> > +                       "Cannot have both PPT and PPM marker.\n");
> > +                return AVERROR_INVALIDDATA;
> > +            }
>
> is a similar check needed before get_ppm() ?
As the PPM marker is in the main headers, it has to come before the PPT markers
for sure. However, it strikes me that a check could be added to ensure
that the PPM
markers actually appear only in the main header and not in the tile
part headers.
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> No human being will ever know the Truth, for even if they happen to say it
> by chance, they would not even known they had done so. -- Xenophanes
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



-- 
-------------
Gautam |


More information about the ffmpeg-devel mailing list