[FFmpeg-trac] #1216(avcodec:open): AVImszh: broken output with rgb24 mode

FFmpeg trac at avcodec.org
Tue Apr 17 21:19:32 CEST 2012


#1216: AVImszh: broken output with rgb24 mode
------------------------------------+-----------------------------------
             Reporter:  ami_stuff   |                    Owner:
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avcodec
              Version:  git-master  |               Resolution:
             Keywords:  mszh        |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+-----------------------------------

Comment (by ami_stuff):

 it looks like AVImszh codec always saves RGB24 data as uncompressed, even
 when "No Compress" option is turned off


 lcldec.c:
 {{{
    switch (avctx->codec_id) {
     case CODEC_ID_MSZH:
         switch (c->compression) {
         case COMP_MSZH:
 +            if (c->imgtype != IMGTYPE_RGB24) {
             if (c->flags & FLAG_MULTITHREAD) {
                 mthread_inlen = AV_RL32(encoded);
                 mthread_inlen = FFMIN(mthread_inlen, len - 8);
                 mthread_outlen = AV_RL32(encoded+4);
                 mthread_outlen = FFMIN(mthread_outlen, c->decomp_size);
                 mszh_dlen = mszh_decomp(encoded + 8, mthread_inlen,
 c->decomp_buf, c->decomp_size);
                 if (mthread_outlen != mszh_dlen) {
                     av_log(avctx, AV_LOG_ERROR, "Mthread1 decoded size
 differs (%d != %d)\n",
                            mthread_outlen, mszh_dlen);
                     return -1;
                 }
                 mszh_dlen = mszh_decomp(encoded + 8 + mthread_inlen, len -
 8 - mthread_inlen,
                                         c->decomp_buf + mthread_outlen,
 c->decomp_size - mthread_outlen);
                 if (mthread_outlen != mszh_dlen) {
                     av_log(avctx, AV_LOG_ERROR, "Mthread2 decoded size
 differs (%d != %d)\n",
                            mthread_outlen, mszh_dlen);
                     return -1;
                 }
                 encoded = c->decomp_buf;
                 len = c->decomp_size;
             } else {
                 mszh_dlen = mszh_decomp(encoded, len, c->decomp_buf,
 c->decomp_size);
                 if (c->decomp_size != mszh_dlen) {
                     av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d
 != %d)\n",
                            c->decomp_size, mszh_dlen);
                     return -1;
                 }
                 encoded = c->decomp_buf;
                 len = mszh_dlen;
             }
 +            }
 }}}

 but these for some reason decodes correctly:

 http://samples.mplayerhq.hu/V-codecs/mszh-zlib/mszh/mszh_rgb24.avi
 http://samples.mplayerhq.hu/V-codecs/mszh-zlib/mszh/mszh_rgb24_nocomp.avi

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1216#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list