diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-28 04:12:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-28 04:12:24 +0200 |
commit | 7b453d1c60005cd1e0461a8d06d07e89116772d4 (patch) | |
tree | 55f5b363a0f6b5f447026edb8e80b38ef8c22437 /libavcodec/dvdata.h | |
parent | 4a619fcae99c7fc8cae7070c7859243c40cdb4bc (diff) | |
parent | 55abaa58e5ede59d497e1ab89d5fe0950d1c6ecf (diff) | |
download | ffmpeg-7b453d1c60005cd1e0461a8d06d07e89116772d4.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
westwood_vqa: fix SND0 chunk handling
westwood_vqa: set video stream duration
raw: forward avpicture_fill() error code in raw_decode().
build: Do not explicitly add the doc directory to the OBJDIRS list.
dv: Split off DV video decoder into its own file.
build: fix RALF decoder standalone compilation, which depends on Golomb code
configure: Drop stray duplicate entry for --disable-fft from help output.
Conflicts:
libavcodec/dv.c
libavcodec/rawdec.c
libavformat/westwood_vqa.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvdata.h')
-rw-r--r-- | libavcodec/dvdata.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h index 8c1be96183..e3ce98ad12 100644 --- a/libavcodec/dvdata.h +++ b/libavcodec/dvdata.h @@ -29,6 +29,8 @@ #include "libavutil/rational.h" #include "avcodec.h" +#include "dsputil.h" +#include "get_bits.h" typedef struct DVwork_chunk { uint16_t buf_offset; @@ -65,6 +67,20 @@ typedef struct DVprofile { const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */ } DVprofile; +typedef struct DVVideoContext { + const DVprofile *sys; + AVFrame picture; + AVCodecContext *avctx; + uint8_t *buf; + + uint8_t dv_zigzag[2][64]; + + void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size); + void (*fdct[2])(DCTELEM *block); + void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block); + me_cmp_func ildct_cmp; +} DVVideoContext; + enum dv_section_type { dv_sect_header = 0x1f, dv_sect_subcode = 0x3f, @@ -106,10 +122,38 @@ enum dv_pack_type { */ #define DV_MAX_BPM 8 +#define TEX_VLC_BITS 9 + +extern RL_VLC_ELEM ff_dv_rl_vlc[1184]; + const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys, const uint8_t* frame, unsigned buf_size); const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile *sys, const uint8_t* frame, unsigned buf_size); const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec); +int ff_dv_init_dynamic_tables(const DVprofile *d); +int ff_dvvideo_init(AVCodecContext *avctx); + +static inline int dv_work_pool_size(const DVprofile *d) +{ + int size = d->n_difchan*d->difseg_size*27; + if (DV_PROFILE_IS_1080i50(d)) + size -= 3*27; + if (DV_PROFILE_IS_720p50(d)) + size -= 4*27; + return size; +} + +static inline void dv_calculate_mb_xy(DVVideoContext *s, DVwork_chunk *work_chunk, int m, int *mb_x, int *mb_y) +{ + *mb_x = work_chunk->mb_coordinates[m] & 0xff; + *mb_y = work_chunk->mb_coordinates[m] >> 8; + + /* We work with 720p frames split in half. The odd half-frame (chan==2,3) is displaced :-( */ + if (s->sys->height == 720 && !(s->buf[1]&0x0C)) { + *mb_y -= (*mb_y>17)?18:-72; /* shifting the Y coordinate down by 72/2 macro blocks */ + } +} + #endif /* AVCODEC_DVDATA_H */ |