Commit 7b453d1c authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 4a619fca 55abaa58
...@@ -118,7 +118,6 @@ Component options: ...@@ -118,7 +118,6 @@ Component options:
--enable-x11grab enable X11 grabbing [no] --enable-x11grab enable X11 grabbing [no]
--disable-network disable network support [no] --disable-network disable network support [no]
--disable-dct disable DCT code --disable-dct disable DCT code
--disable-fft disable FFT code
--disable-mdct disable MDCT code --disable-mdct disable MDCT code
--disable-rdft disable RDFT code --disable-rdft disable RDFT code
--disable-fft disable FFT code --disable-fft disable FFT code
...@@ -1482,6 +1481,7 @@ png_encoder_select="zlib" ...@@ -1482,6 +1481,7 @@ png_encoder_select="zlib"
qcelp_decoder_select="lsp" qcelp_decoder_select="lsp"
qdm2_decoder_select="mdct rdft mpegaudiodsp" qdm2_decoder_select="mdct rdft mpegaudiodsp"
ra_144_encoder_select="lpc" ra_144_encoder_select="lpc"
ralf_decoder_select="golomb"
rv10_decoder_select="h263_decoder" rv10_decoder_select="h263_decoder"
rv10_encoder_select="h263_encoder" rv10_encoder_select="h263_encoder"
rv20_decoder_select="h263_decoder" rv20_decoder_select="h263_decoder"
......
...@@ -52,7 +52,6 @@ doc/%.1: doc/%.pod $(GENTEXI) ...@@ -52,7 +52,6 @@ doc/%.1: doc/%.pod $(GENTEXI)
$(M)pod2man --section=1 --center=" " --release=" " $< > $@ $(M)pod2man --section=1 --center=" " --release=" " $< > $@
$(DOCS): | doc $(DOCS): | doc
OBJDIRS += doc
install-progs-$(CONFIG_DOC): install-man install-progs-$(CONFIG_DOC): install-man
......
...@@ -138,7 +138,7 @@ OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o ...@@ -138,7 +138,7 @@ OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
OBJS-$(CONFIG_DXA_DECODER) += dxa.o OBJS-$(CONFIG_DXA_DECODER) += dxa.o
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
......
This diff is collapsed.
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#define AVCODEC_DV_TABLEGEN_H #define AVCODEC_DV_TABLEGEN_H
#include <stdint.h> #include <stdint.h>
#include "libavutil/attributes.h"
#include "dv_vlc_data.h" #include "dv_vlc_data.h"
#if CONFIG_SMALL #if CONFIG_SMALL
...@@ -46,7 +48,7 @@ typedef struct dv_vlc_pair { ...@@ -46,7 +48,7 @@ typedef struct dv_vlc_pair {
#else #else
static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE]; static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE];
static void dv_vlc_map_tableinit(void) static void av_unused dv_vlc_map_tableinit(void)
{ {
int i, j; int i, j;
for (i = 0; i < NB_DV_VLC - 1; i++) { for (i = 0; i < NB_DV_VLC - 1; i++) {
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include "libavutil/rational.h" #include "libavutil/rational.h"
#include "avcodec.h" #include "avcodec.h"
#include "dsputil.h"
#include "get_bits.h"
typedef struct DVwork_chunk { typedef struct DVwork_chunk {
uint16_t buf_offset; uint16_t buf_offset;
...@@ -65,6 +67,20 @@ typedef struct DVprofile { ...@@ -65,6 +67,20 @@ typedef struct DVprofile {
const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */ const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
} DVprofile; } 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 { enum dv_section_type {
dv_sect_header = 0x1f, dv_sect_header = 0x1f,
dv_sect_subcode = 0x3f, dv_sect_subcode = 0x3f,
...@@ -106,10 +122,38 @@ enum dv_pack_type { ...@@ -106,10 +122,38 @@ enum dv_pack_type {
*/ */
#define DV_MAX_BPM 8 #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 DVprofile* avpriv_dv_frame_profile(const DVprofile *sys,
const uint8_t* frame, unsigned buf_size); const uint8_t* frame, unsigned buf_size);
const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile *sys, const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile *sys,
const uint8_t* frame, unsigned buf_size); const uint8_t* frame, unsigned buf_size);
const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec); 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 */ #endif /* AVCODEC_DVDATA_H */
This diff is collapsed.
...@@ -139,6 +139,7 @@ static int raw_decode(AVCodecContext *avctx, ...@@ -139,6 +139,7 @@ static int raw_decode(AVCodecContext *avctx,
int buf_size = avpkt->size; int buf_size = avpkt->size;
int linesize_align = 4; int linesize_align = 4;
RawVideoContext *context = avctx->priv_data; RawVideoContext *context = avctx->priv_data;
int res;
AVFrame *frame = data; AVFrame *frame = data;
AVPicture *picture = data; AVPicture *picture = data;
...@@ -190,7 +191,9 @@ static int raw_decode(AVCodecContext *avctx, ...@@ -190,7 +191,9 @@ static int raw_decode(AVCodecContext *avctx,
if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0)) if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0))
return -1; return -1;
avpicture_fill(picture, buf, avctx->pix_fmt, avctx->width, avctx->height); if ((res = avpicture_fill(picture, buf, avctx->pix_fmt,
avctx->width, avctx->height)) < 0)
return res;
if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) || if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) ||
(av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) { (av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) {
frame->data[1]= context->palette; frame->data[1]= context->palette;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment