Revision d9b1c197

View differences:

CREDITS
23 23
Robin Kay
24 24
Todd Kirby
25 25
Nick Kurshev
26
Benjamin Larsson
26 27
Lo?c Le Loarer
27 28
Mike Melanson
28 29
Loren Merritt
doc/ffmpeg-doc.texi
851 851
@tab QuickTime fourcc 'alac'
852 852
@item FFmpeg Sonic           @tab X    @tab X
853 853
@tab experimental lossy/lossless codec
854
@item Qdesign QDM2           @tab      @tab X
855
@tab there are still some distortions
854 856
@end multitable
855 857

  
856 858
@code{X} means that encoding (resp. decoding) is supported.
libavcodec/Makefile
18 18
      fft.o mdct.o raw.o golomb.o cabac.o\
19 19
      dpcm.o adx.o faandct.o parser.o g726.o \
20 20
      vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o dvdsub.o dvbsub.o dvbsubdec.o\
21
      opt.o truemotion2.o
21
      opt.o qdm2.o truemotion2.o
22 22

  
23 23
ifeq ($(CONFIG_AASC_DECODER),yes)
24 24
    OBJS+= aasc.o
libavcodec/allcodecs.c
491 491
#ifdef CONFIG_LIBGSM
492 492
    register_avcodec(&libgsm_decoder);
493 493
#endif //CONFIG_LIBGSM
494
#ifdef CONFIG_QDM2_DECODER
495
    register_avcodec(&qdm2_decoder);
496
#endif //CONFIG_QDM2_DECODER
494 497
#endif /* CONFIG_DECODERS */
495 498

  
496 499
#ifdef AMR_NB
libavcodec/avcodec.h
185 185
    CODEC_ID_ALAC,
186 186
    CODEC_ID_WESTWOOD_SND1,
187 187
    CODEC_ID_GSM,    
188
    CODEC_ID_QDM2,
188 189
    
189 190
    CODEC_ID_OGGTHEORA= 0x16000, 
190 191

  
......
2000 2001
extern AVCodec mp3_decoder;
2001 2002
extern AVCodec mp3adu_decoder;
2002 2003
extern AVCodec mp3on4_decoder;
2004
extern AVCodec qdm2_decoder;
2003 2005
extern AVCodec mace3_decoder;
2004 2006
extern AVCodec mace6_decoder;
2005 2007
extern AVCodec huffyuv_decoder;
libavcodec/mpegaudio.c
28 28

  
29 29
/* currently, cannot change these constants (need to modify
30 30
   quantization stage) */
31
#define FRAC_BITS 15
32
#define WFRAC_BITS  14
33 31
#define MUL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
34 32
#define FIX(a)   ((int)((a) * (1 << FRAC_BITS)))
35 33

  
libavcodec/mpegaudio.h
22 22
#define SAME_HEADER_MASK \
23 23
   (0xffe00000 | (3 << 17) | (0xf << 12) | (3 << 10) | (3 << 19))
24 24

  
25
/* define USE_HIGHPRECISION to have a bit exact (but slower) mpeg
26
   audio decoder */
27

  
28
#ifdef USE_HIGHPRECISION
29
#define FRAC_BITS   23   /* fractional bits for sb_samples and dct */
30
#define WFRAC_BITS  16   /* fractional bits for window */
31
#else
32
#define FRAC_BITS   15   /* fractional bits for sb_samples and dct */
33
#define WFRAC_BITS  14   /* fractional bits for window */
34
#endif
35

  
36
#if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT)
37
typedef int32_t OUT_INT;
38
#define OUT_MAX INT32_MAX
39
#define OUT_MIN INT32_MIN
40
#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 31)
41
#else
42
typedef int16_t OUT_INT;
43
#define OUT_MAX INT16_MAX
44
#define OUT_MIN INT16_MIN
45
#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
46
#endif
47

  
48
#if FRAC_BITS <= 15
49
typedef int16_t MPA_INT;
50
#else
51
typedef int32_t MPA_INT;
52
#endif
53

  
25 54
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
26 55
int mpa_decode_header(AVCodecContext *avctx, uint32_t head);
56
void ff_mpa_synth_init(MPA_INT *window);
57
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
58
			 MPA_INT *window, int *dither_state,
59
                         OUT_INT *samples, int incr,
60
                         int32_t sb_samples[SBLIMIT]);
27 61

  
28 62
extern const uint16_t mpa_bitrate_tab[2][3][15];
29 63
extern const uint16_t mpa_freq_tab[3];
libavcodec/mpegaudiodec.c
25 25
//#define DEBUG
26 26
#include "avcodec.h"
27 27
#include "bitstream.h"
28
#include "mpegaudio.h"
29 28
#include "dsputil.h"
30 29

  
31 30
/*
......
40 39
#define USE_HIGHPRECISION
41 40
#endif
42 41

  
43
#ifdef USE_HIGHPRECISION
44
#define FRAC_BITS   23   /* fractional bits for sb_samples and dct */
45
#define WFRAC_BITS  16   /* fractional bits for window */
46
#else
47
#define FRAC_BITS   15   /* fractional bits for sb_samples and dct */
48
#define WFRAC_BITS  14   /* fractional bits for window */
49
#endif
50

  
51
#if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT)
52
typedef int32_t OUT_INT;
53
#define OUT_MAX INT32_MAX
54
#define OUT_MIN INT32_MIN
55
#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 31)
56
#else
57
typedef int16_t OUT_INT;
58
#define OUT_MAX INT16_MAX
59
#define OUT_MIN INT16_MIN
60
#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
61
#endif
42
#include "mpegaudio.h"
62 43

  
63 44
#define FRAC_ONE    (1 << FRAC_BITS)
64 45

  
......
75 56
    return ((int64_t)(a) * (int64_t)(b))>>32;
76 57
}
77 58

  
78
#if FRAC_BITS <= 15
79
typedef int16_t MPA_INT;
80
#else
81
typedef int32_t MPA_INT;
82
#endif
83

  
84 59
/****************/
85 60

  
86 61
#define HEADER_SIZE 4
libavformat/mov.c
145 145
    { CODEC_ID_AMR_WB, MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */
146 146
    { CODEC_ID_AC3, MKTAG('m', 's', 0x20, 0x00) }, /* Dolby AC-3 */
147 147
    { CODEC_ID_ALAC,MKTAG('a', 'l', 'a', 'c') }, /* Apple Lossless */
148
    { CODEC_ID_QDM2,MKTAG('Q', 'D', 'M', '2') }, /* QDM2 */
148 149
    { CODEC_ID_NONE, 0 },
149 150
};
150 151

  
......
709 710
    return 0;
710 711
}
711 712

  
713
static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
714
{
715
    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
716

  
717
    if((uint64_t)atom.size > (1<<30))
718
        return -1;
719
    
720
    // pass all frma atom to codec, needed at least for QDM2
721
    av_free(st->codec->extradata);
722
    st->codec->extradata_size = atom.size;
723
    st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
724

  
725
    if (st->codec->extradata) {
726
	get_buffer(pb, st->codec->extradata, atom.size);
727
	//av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld  %s\n", atom.size, (char*)st->codec->extradata);
728
    } else
729
	url_fskip(pb, atom.size);
730

  
731
    return 0;
732
}
733

  
712 734
static int mov_read_avcC(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
713 735
{
714 736
    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
......
1605 1627
{ MKTAG( 'u', 'r', 'n', ' ' ), mov_read_leaf },
1606 1628
{ MKTAG( 'u', 'u', 'i', 'd' ), mov_read_leaf },
1607 1629
{ MKTAG( 'v', 'm', 'h', 'd' ), mov_read_leaf }, /* video media info header */
1608
{ MKTAG( 'w', 'a', 'v', 'e' ), mov_read_default },
1630
{ MKTAG( 'w', 'a', 'v', 'e' ), mov_read_wave },
1609 1631
/* extra mp4 */
1610 1632
{ MKTAG( 'M', 'D', 'E', 'S' ), mov_read_leaf },
1611 1633
/* QT atoms */

Also available in: Unified diff