summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/dv.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2005-04-19 05:16:45 +0000
committerMike Melanson <mike@multimedia.cx>2005-04-19 05:16:45 +0000
commit97c50cb77949856573d7f5f5a3c28cb73e61e011 (patch)
tree2dbabcbb9009b09d66789498ce1d2451a4b39bc0 /src/libffmpeg/libavcodec/dv.c
parent19e7199dad84489aa49e3b2dd5c0e45657ec0fb8 (diff)
downloadxine-lib-97c50cb77949856573d7f5f5a3c28cb73e61e011.tar.gz
xine-lib-97c50cb77949856573d7f5f5a3c28cb73e61e011.tar.bz2
sync to FFmpeg build 4752
CVS patchset: 7463 CVS date: 2005/04/19 05:16:45
Diffstat (limited to 'src/libffmpeg/libavcodec/dv.c')
-rw-r--r--src/libffmpeg/libavcodec/dv.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libffmpeg/libavcodec/dv.c b/src/libffmpeg/libavcodec/dv.c
index 8e359e361..94440ed5c 100644
--- a/src/libffmpeg/libavcodec/dv.c
+++ b/src/libffmpeg/libavcodec/dv.c
@@ -144,7 +144,7 @@ static int dvvideo_init(AVCodecContext *avctx)
/* NOTE: as a trick, we use the fact the no codes are unused
to accelerate the parsing of partial codes */
init_vlc(&dv_vlc, TEX_VLC_BITS, j,
- new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2);
+ new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0);
dv_rl_vlc = av_malloc(dv_vlc.table_size * sizeof(RL_VLC_ELEM));
if (!dv_rl_vlc) {
@@ -263,6 +263,7 @@ static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
#ifndef ALT_BITSTREAM_READER
#warning only works with ALT_BITSTREAM_READER
+static int re_index; //Hack to make it compile
#endif
static inline int get_bits_left(GetBitContext *s)
@@ -394,8 +395,7 @@ static inline void dv_decode_video_segment(DVVideoContext *s,
init_get_bits(&gb, buf_ptr, last_index);
/* get the dc */
- dc = get_bits(&gb, 9);
- dc = (dc << (32 - 9)) >> (32 - 9);
+ dc = get_sbits(&gb, 9);
dct_mode = get_bits1(&gb);
mb->dct_mode = dct_mode;
mb->scan_table = s->dv_zigzag[dct_mode];
@@ -889,10 +889,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
{
DVVideoContext *s = avctx->priv_data;
- /* special case for last picture */
- if(buf_size==0)
- return 0;
-
s->sys = dv_frame_profile(buf);
if (!s->sys || buf_size < s->sys->frame_size)
return -1; /* NOTE: we only accept several full frames */
@@ -932,7 +928,9 @@ static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
s->sys = dv_codec_profile(c);
if (!s->sys)
return -1;
-
+ if(buf_size < s->sys->frame_size)
+ return -1;
+
c->pix_fmt = s->sys->pix_fmt;
s->picture = *((AVFrame *)data);