~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libavcodec/flicvideo.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-12-21 15:32:13 UTC
  • mto: (1.2.18)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20121221153213-fudzrugjzivtv0wp
Tags: upstream-9~beta3
ImportĀ upstreamĀ versionĀ 9~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
}
130
130
 
131
131
static int flic_decode_frame_8BPP(AVCodecContext *avctx,
132
 
                                  void *data, int *data_size,
 
132
                                  void *data, int *got_frame,
133
133
                                  const uint8_t *buf, int buf_size)
134
134
{
135
135
    FlicDecodeContext *s = avctx->priv_data;
419
419
        s->new_palette = 0;
420
420
    }
421
421
 
422
 
    *data_size=sizeof(AVFrame);
 
422
    *got_frame = 1;
423
423
    *(AVFrame*)data = s->frame;
424
424
 
425
425
    return buf_size;
426
426
}
427
427
 
428
428
static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
429
 
                                      void *data, int *data_size,
 
429
                                      void *data, int *got_frame,
430
430
                                      const uint8_t *buf, int buf_size)
431
431
{
432
432
    /* Note, the only difference between the 15Bpp and 16Bpp */
581
581
                }
582
582
 
583
583
                /* Now FLX is strange, in that it is "byte" as opposed to "pixel" run length compressed.
584
 
                 * This does not give us any good oportunity to perform word endian conversion
 
584
                 * This does not give us any good opportunity to perform word endian conversion
585
585
                 * during decompression. So if it is required (i.e., this is not a LE target, we do
586
586
                 * a second pass over the line here, swapping the bytes.
587
587
                 */
681
681
               "and final chunk ptr = %d\n", buf_size, bytestream2_tell(&g2));
682
682
 
683
683
 
684
 
    *data_size=sizeof(AVFrame);
 
684
    *got_frame = 1;
685
685
    *(AVFrame*)data = s->frame;
686
686
 
687
687
    return buf_size;
688
688
}
689
689
 
690
690
static int flic_decode_frame_24BPP(AVCodecContext *avctx,
691
 
                                   void *data, int *data_size,
 
691
                                   void *data, int *got_frame,
692
692
                                   const uint8_t *buf, int buf_size)
693
693
{
694
694
  av_log(avctx, AV_LOG_ERROR, "24Bpp FLC Unsupported due to lack of test files.\n");
696
696
}
697
697
 
698
698
static int flic_decode_frame(AVCodecContext *avctx,
699
 
                             void *data, int *data_size,
 
699
                             void *data, int *got_frame,
700
700
                             AVPacket *avpkt)
701
701
{
702
702
    const uint8_t *buf = avpkt->data;
703
703
    int buf_size = avpkt->size;
704
704
    if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
705
 
      return flic_decode_frame_8BPP(avctx, data, data_size,
 
705
      return flic_decode_frame_8BPP(avctx, data, got_frame,
706
706
                                    buf, buf_size);
707
707
    }
708
708
    else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) ||
709
709
             (avctx->pix_fmt == AV_PIX_FMT_RGB565)) {
710
 
      return flic_decode_frame_15_16BPP(avctx, data, data_size,
 
710
      return flic_decode_frame_15_16BPP(avctx, data, got_frame,
711
711
                                        buf, buf_size);
712
712
    }
713
713
    else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) {
714
 
      return flic_decode_frame_24BPP(avctx, data, data_size,
 
714
      return flic_decode_frame_24BPP(avctx, data, got_frame,
715
715
                                     buf, buf_size);
716
716
    }
717
717