#370 the decoder/encoder order of MJLS in riff.c is wrong

closed-fixed
nobody
None
5
2007-05-30
2007-01-06
Samuel Audet
No

Currently, we have this listing in riff.c:
{ CODEC_ID_MJPEG, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - decoder */
{ CODEC_ID_JPEGLS, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - encoder */

But is should actually be as follows so that the correct code is used for encoding by default:
{ CODEC_ID_JPEGLS, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - encoder */
{ CODEC_ID_MJPEG, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - decoder */

I attached a small patch...

Discussion

  • Samuel Audet
    Samuel Audet
    2007-01-06

    a patch for riff.c to fix the ordering of MJLS tags

     
    Attachments
  • Logged In: YES
    user_id=282150
    Originator: NO

    both jpeg and jpeg-ls use the correct fourcc for encoding, the issue you describe is not reproduceable

     
    • status: open --> closed-works-for-me
     
  • Samuel Audet
    Samuel Audet
    2007-05-30

    Logged In: YES
    user_id=1584125
    Originator: YES

    Ok, maybe I wasn't clear enough... the fourcc for encoding is fine, what is not fine is the _codec_. CODED_ID_MJPEG can _decode_ MJLS, but it *CANNOT* _encode_ MJLS. To encode MJLS, you need to use CODEC_ID_JPEGLS, and right now, because of the wrong order of the listing in riff.c, codec_get_bmp_id(MJLS) will not return CODEC_ID_JPEGLS as it should.

    Here's the quote from riff.c:
    /* Note: when encoding, the first matching tag is used, so order is
    important if multiple tags possible for a given codec. */

    thanks for correcting this...

     
  • Samuel Audet
    Samuel Audet
    2007-05-30

    • status: closed-works-for-me --> open-works-for-me
     
    • status: open-works-for-me --> closed-fixed
     
  • Logged In: YES
    user_id=282150
    Originator: NO

    ok, fixed
    btw1, there are more cases in riff.c which are ordered oddly (patch welcome)
    btw2, i suggest you use the ffmpeg-devel mailinglist (the sf bugtracker is just checked once every few month by me)

     
  • Samuel Audet
    Samuel Audet
    2007-05-31

    Logged In: YES
    user_id=1584125
    Originator: YES

    Hum ok, I don't use a lot of the codecs in FFMPEG, but will post a patch on the mailing list if I see anything else.. thanks!