[FFmpeg-trac] #1648(undetermined:new): avdj (mjpeg): problem with ntsc interlaced

FFmpeg trac at avcodec.org
Fri Aug 17 17:00:04 CEST 2012


#1648: avdj (mjpeg): problem with ntsc interlaced
-------------------------------------+-------------------------------------
             Reporter:  ami_stuff    |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  unspecified  |  undetermined
             Keywords:               |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by ami_stuff):

 the solution could be to check for MKTAG and metadata for ntsc (1 - ntsc,
 2 - pal - see "ntsc.jpg")

 libavcodec/mjpegdec.c:
 {{{
 av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
 {
     MJpegDecodeContext *s = avctx->priv_data;

     if (!s->picture_ptr)
         s->picture_ptr = &s->picture;
     avcodec_get_frame_defaults(&s->picture);


     s->avctx = avctx;
     ff_dsputil_init(&s->dsp, avctx);
     ff_init_scantable(s->dsp.idct_permutation, &s->scantable,
 ff_zigzag_direct);
     s->buffer_size   = 0;
     s->buffer        = NULL;
     s->start_code    = -1;
     s->first_picture = 1;
     s->org_height    = avctx->coded_height;
     avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;

     build_basic_mjpeg_vlc(s);

     if (s->extern_huff) {
         av_log(avctx, AV_LOG_INFO, "using external huffman table\n");
         init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size *
 8);
         if (ff_mjpeg_decode_dht(s)) {
             av_log(avctx, AV_LOG_ERROR,
                    "error using external huffman table, switching back to
 internal\n");
             build_basic_mjpeg_vlc(s);
         }
     }
 -    if (avctx->field_order == AV_FIELD_BB || s->avctx->codec_tag ==
 MKTAG('A', 'V', 'D', 'J')) { /* quicktime icefloe 019 */
 +    if (avctx->field_order == AV_FIELD_BB || s->avctx->codec_tag ==
 MKTAG('A', 'V', 'D', 'J') && ntsc_mode) { /* quicktime icefloe 019 */
         s->interlace_polarity = 1;           /* bottom field first */
         av_log(avctx, AV_LOG_DEBUG, "bottom field first\n");
     }
     if (avctx->codec->id == CODEC_ID_AMV)
         s->flipped = 1;

     return 0;
 }
 }}}

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


More information about the FFmpeg-trac mailing list