Revision 5acd8d9e

View differences:

libavcodec/Makefile
97 97
OBJS-$(CONFIG_INDEO3_DECODER)          += indeo3.o
98 98
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
99 99
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER)  += dpcm.o
100
OBJS-$(CONFIG_JPEGLS_DECODER)          += jpeglsdec.o jpegls.o mjpegdec.o mjpeg.o
100 101
OBJS-$(CONFIG_JPEGLS_ENCODER)          += jpeglsenc.o jpegls.o
101 102
OBJS-$(CONFIG_KMVC_DECODER)            += kmvc.o
102 103
OBJS-$(CONFIG_LJPEG_ENCODER)           += ljpegenc.o mjpegenc.o mjpeg.o mpegvideo.o
103 104
OBJS-$(CONFIG_LOCO_DECODER)            += loco.o
104 105
OBJS-$(CONFIG_MACE3_DECODER)           += mace.o
105 106
OBJS-$(CONFIG_MACE6_DECODER)           += mace.o
106
OBJS-$(CONFIG_MJPEG_DECODER)           += mjpegdec.o mjpeg.o jpeglsdec.o jpegls.o
107
OBJS-$(CONFIG_MJPEG_DECODER)           += mjpegdec.o mjpeg.o
107 108
OBJS-$(CONFIG_MJPEG_ENCODER)           += mjpegenc.o mjpeg.o mpegvideo.o
108
OBJS-$(CONFIG_MJPEGB_DECODER)          += mjpegdec.o mjpeg.o jpeglsdec.o jpegls.o
109
OBJS-$(CONFIG_MJPEGB_DECODER)          += mjpegdec.o mjpeg.o
109 110
OBJS-$(CONFIG_MMVIDEO_DECODER)         += mmvideo.o
110 111
OBJS-$(CONFIG_MP2_ENCODER)             += mpegaudio.o mpegaudiodata.o
111 112
OBJS-$(CONFIG_MPC7_DECODER)            += mpc.o
......
153 154
OBJS-$(CONFIG_SONIC_DECODER)           += sonic.o
154 155
OBJS-$(CONFIG_SONIC_ENCODER)           += sonic.o
155 156
OBJS-$(CONFIG_SONIC_LS_DECODER)        += sonic.o
156
OBJS-$(CONFIG_SP5X_DECODER)            += mjpegdec.o mjpeg.o jpeglsdec.o jpegls.o
157
OBJS-$(CONFIG_SP5X_DECODER)            += mjpegdec.o mjpeg.o
157 158
OBJS-$(CONFIG_SVQ1_DECODER)            += svq1.o
158 159
OBJS-$(CONFIG_SVQ1_ENCODER)            += svq1.o
159 160
OBJS-$(CONFIG_SVQ3_DECODER)            += h264.o
160 161
OBJS-$(CONFIG_TARGA_DECODER)           += targa.o
161 162
OBJS-$(CONFIG_TARGA_ENCODER)           += targaenc.o rle.o
162 163
OBJS-$(CONFIG_THEORA_DECODER)          += vp3.o xiph.o vp3dsp.o
163
OBJS-$(CONFIG_THP_DECODER)             += mjpegdec.o mjpeg.o jpeglsdec.o jpegls.o
164
OBJS-$(CONFIG_THP_DECODER)             += mjpegdec.o mjpeg.o
164 165
OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
165 166
OBJS-$(CONFIG_TIFF_DECODER)            += tiff.o lzw.o
166 167
OBJS-$(CONFIG_TIFF_ENCODER)            += tiffenc.o rle.o lzwenc.o
libavcodec/allcodecs.c
91 91
    REGISTER_DECODER(INDEO2, indeo2);
92 92
    REGISTER_DECODER(INDEO3, indeo3);
93 93
    REGISTER_DECODER(INTERPLAY_VIDEO, interplay_video);
94
    REGISTER_ENCODER(JPEGLS, jpegls);
94
    REGISTER_ENCDEC (JPEGLS, jpegls);
95 95
    REGISTER_DECODER(KMVC, kmvc);
96 96
    REGISTER_ENCODER(LJPEG, ljpeg);
97 97
    REGISTER_DECODER(LOCO, loco);
libavcodec/avcodec.h
2282 2282
extern AVCodec indeo3_decoder;
2283 2283
extern AVCodec interplay_dpcm_decoder;
2284 2284
extern AVCodec interplay_video_decoder;
2285
extern AVCodec jpegls_decoder;
2285 2286
extern AVCodec kmvc_decoder;
2286 2287
extern AVCodec loco_decoder;
2287 2288
extern AVCodec mace3_decoder;
libavcodec/jpeglsdec.c
29 29
#include "bitstream.h"
30 30
#include "golomb.h"
31 31
#include "mjpeg.h"
32
#include "mjpegdec.h"
32 33
#include "jpegls.h"
33 34
#include "jpeglsdec.h"
34 35

  
......
359 360

  
360 361
    return 0;
361 362
}
363

  
364

  
365
AVCodec jpegls_decoder = {
366
    "jpegls",
367
    CODEC_TYPE_VIDEO,
368
    CODEC_ID_JPEGLS,
369
    sizeof(MJpegDecodeContext),
370
    ff_mjpeg_decode_init,
371
    NULL,
372
    ff_mjpeg_decode_end,
373
    ff_mjpeg_decode_frame,
374
    CODEC_CAP_DR1,
375
};
libavcodec/mjpegdec.c
36 36
#include "avcodec.h"
37 37
#include "dsputil.h"
38 38
#include "mjpeg.h"
39
#include "mjpegdec.h"
39 40
#include "jpeglsdec.h"
40 41

  
41 42

  
......
63 64
    return init_vlc(vlc, 9, nb_codes, huff_size, 1, 1, huff_code, 2, 2, use_static);
64 65
}
65 66

  
66
static int mjpeg_decode_init(AVCodecContext *avctx)
67
int ff_mjpeg_decode_init(AVCodecContext *avctx)
67 68
{
68 69
    MJpegDecodeContext *s = avctx->priv_data;
69 70

  
......
802 803
        skip_bits(&s->gb, 8);
803 804

  
804 805
    if(s->lossless){
805
        if(s->ls){
806
        if(ENABLE_JPEGLS_DECODER && s->ls){
806 807
//            for(){
807 808
//            reset_ls_coding_parameters(s, 0);
808 809

  
......
1075 1076
    return val;
1076 1077
}
1077 1078

  
1078
static int mjpeg_decode_frame(AVCodecContext *avctx,
1079
int ff_mjpeg_decode_frame(AVCodecContext *avctx,
1079 1080
                              void *data, int *data_size,
1080 1081
                              uint8_t *buf, int buf_size)
1081 1082
{
......
1237 1238
                        return -1;
1238 1239
                    break;
1239 1240
                case LSE:
1240
                    if (ff_jpegls_decode_lse(s) < 0)
1241
                    if (!ENABLE_JPEGLS_DECODER || ff_jpegls_decode_lse(s) < 0)
1241 1242
                        return -1;
1242 1243
                    break;
1243 1244
                case EOI:
......
1473 1474
    recoded[j++] = 0xFF;
1474 1475
    recoded[j++] = 0xD9;
1475 1476

  
1476
    i = mjpeg_decode_frame(avctx, data, data_size, recoded, j);
1477
    i = ff_mjpeg_decode_frame(avctx, data, data_size, recoded, j);
1477 1478

  
1478 1479
    av_free(recoded);
1479 1480

  
......
1572 1573
    return i;
1573 1574
}
1574 1575

  
1575
static int mjpeg_decode_end(AVCodecContext *avctx)
1576
int ff_mjpeg_decode_end(AVCodecContext *avctx)
1576 1577
{
1577 1578
    MJpegDecodeContext *s = avctx->priv_data;
1578 1579
    int i, j;
......
1592 1593
    CODEC_TYPE_VIDEO,
1593 1594
    CODEC_ID_MJPEG,
1594 1595
    sizeof(MJpegDecodeContext),
1595
    mjpeg_decode_init,
1596
    ff_mjpeg_decode_init,
1596 1597
    NULL,
1597
    mjpeg_decode_end,
1598
    mjpeg_decode_frame,
1598
    ff_mjpeg_decode_end,
1599
    ff_mjpeg_decode_frame,
1599 1600
    CODEC_CAP_DR1,
1600 1601
    NULL
1601 1602
};
......
1605 1606
    CODEC_TYPE_VIDEO,
1606 1607
    CODEC_ID_THP,
1607 1608
    sizeof(MJpegDecodeContext),
1608
    mjpeg_decode_init,
1609
    ff_mjpeg_decode_init,
1609 1610
    NULL,
1610
    mjpeg_decode_end,
1611
    mjpeg_decode_frame,
1611
    ff_mjpeg_decode_end,
1612
    ff_mjpeg_decode_frame,
1612 1613
    CODEC_CAP_DR1,
1613 1614
    NULL
1614 1615
};
......
1618 1619
    CODEC_TYPE_VIDEO,
1619 1620
    CODEC_ID_MJPEGB,
1620 1621
    sizeof(MJpegDecodeContext),
1621
    mjpeg_decode_init,
1622
    ff_mjpeg_decode_init,
1622 1623
    NULL,
1623
    mjpeg_decode_end,
1624
    ff_mjpeg_decode_end,
1624 1625
    mjpegb_decode_frame,
1625 1626
    CODEC_CAP_DR1,
1626 1627
    NULL
......
1631 1632
    CODEC_TYPE_VIDEO,
1632 1633
    CODEC_ID_SP5X,
1633 1634
    sizeof(MJpegDecodeContext),
1634
    mjpeg_decode_init,
1635
    ff_mjpeg_decode_init,
1635 1636
    NULL,
1636
    mjpeg_decode_end,
1637
    ff_mjpeg_decode_end,
1637 1638
    sp5x_decode_frame,
1638 1639
    CODEC_CAP_DR1,
1639 1640
    NULL

Also available in: Unified diff