}
#define SVQ1_CALC_CODEBOOK_ENTRIES(cbook)\
- codebook = (uint32_t *) cbook[level];\
+ codebook = (const uint32_t *) cbook[level];\
bit_cache = get_bits (bitbuf, 4*stages);\
/* calculate codebook entries for this vector */\
for (j=0; j < stages; j++) {\
vlc_code_t *vlc;
uint8_t *list[63];
uint32_t *dst;
- uint32_t *codebook;
+ const uint32_t *codebook;
int entries[6];
int i, j, m, n;
int mean, stages;
- int x, y, width, height, level;
+ unsigned x, y, width, height, level;
uint32_t n1, n2, n3, n4;
/* initialize list for breadth first processing of vectors */
vlc_code_t *vlc;
uint8_t *list[63];
uint32_t *dst;
- uint32_t *codebook;
+ const uint32_t *codebook;
int entries[6];
int i, j, m, n;
int mean, stages;
}
}
-static int svq1_motion_inter_block (bit_buffer_t *bitbuf,
+static int svq1_motion_inter_block (MpegEncContext *s, bit_buffer_t *bitbuf,
uint8_t *current, uint8_t *previous, int pitch,
svq1_pmv_t *motion, int x, int y) {
uint8_t *src;
src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch];
dst = current;
- put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst,src,pitch,16);
- put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst+8,src+8,pitch,16);
+ s->dsp.put_pixels_tab[0][((mv.y & 1) << 1) | (mv.x & 1)](dst,src,pitch,16);
return 0;
}
-static int svq1_motion_inter_4v_block (bit_buffer_t *bitbuf,
+static int svq1_motion_inter_4v_block (MpegEncContext *s, bit_buffer_t *bitbuf,
uint8_t *current, uint8_t *previous, int pitch,
svq1_pmv_t *motion,int x, int y) {
uint8_t *src;
src = &previous[(x + (pmv[i]->x >> 1)) + (y + (pmv[i]->y >> 1))*pitch];
dst = current;
- put_pixels_tab[((pmv[i]->y & 1) << 1) | (pmv[i]->x & 1)](dst,src,pitch,8);
+ s->dsp.put_pixels_tab[1][((pmv[i]->y & 1) << 1) | (pmv[i]->x & 1)](dst,src,pitch,8);
/* select next block */
if (i & 1) {
return 0;
}
-static int svq1_decode_delta_block (bit_buffer_t *bitbuf,
+static int svq1_decode_delta_block (MpegEncContext *s, bit_buffer_t *bitbuf,
uint8_t *current, uint8_t *previous, int pitch,
svq1_pmv_t *motion, int x, int y) {
uint32_t bit_cache;
break;
case SVQ1_BLOCK_INTER:
- result = svq1_motion_inter_block (bitbuf, current, previous, pitch, motion, x, y);
+ result = svq1_motion_inter_block (s, bitbuf, current, previous, pitch, motion, x, y);
if (result != 0)
{
break;
case SVQ1_BLOCK_INTER_4V:
- result = svq1_motion_inter_4v_block (bitbuf, current, previous, pitch, motion, x, y);
+ result = svq1_motion_inter_4v_block (s, bitbuf, current, previous, pitch, motion, x, y);
if (result != 0)
{
MpegEncContext *s=avctx->priv_data;
uint8_t *current, *previous;
int result, i, x, y, width, height;
- AVPicture *pict = data;
+ AVFrame *pict = data;
/* initialize bit buffer */
init_get_bits(&s->gb,buf,buf_size);
}
result = svq1_decode_frame_header (&s->gb, s);
-
- MPV_frame_start(s, avctx);
if (result != 0)
{
if(avctx->hurry_up && s->pict_type==B_TYPE) return buf_size;
+ if(MPV_frame_start(s, avctx) < 0)
+ return -1;
+
/* decode y, u and v components */
for (i=0; i < 3; i++) {
int linesize;
linesize= s->uvlinesize;
}
- current = s->current_picture[i];
+ current = s->current_picture.data[i];
if(s->pict_type==B_TYPE){
- previous = s->next_picture[i];
+ previous = s->next_picture.data[i];
}else{
- previous = s->last_picture[i];
+ previous = s->last_picture.data[i];
}
if (s->pict_type == I_TYPE) {
for (y=0; y < height; y+=16) {
for (x=0; x < width; x+=16) {
- result = svq1_decode_delta_block (&s->gb, ¤t[x], previous,
- linesize, pmv, x, y);
+ result = svq1_decode_delta_block (s, &s->gb, ¤t[x], previous,
+ linesize, pmv, x, y);
if (result != 0)
{
#ifdef DEBUG_SVQ1
current += 16*linesize;
}
}
-
- pict->data[i] = s->current_picture[i];
- pict->linesize[i] = linesize;
}
+
+ *pict = *(AVFrame*)&s->current_picture;
- *data_size=sizeof(AVPicture);
+
+ MPV_frame_end(s);
+
+ *data_size=sizeof(AVFrame);
return buf_size;
}
s->width = (avctx->width+3)&~3;
s->height = (avctx->height+3)&~3;
s->codec_id= avctx->codec->id;
- avctx->mbskip_table= s->mbskip_table;
avctx->pix_fmt = PIX_FMT_YUV410P;
- avctx->has_b_frames= s->has_b_frames=1; // not true, but DP frames and these behave like unidirectional b frames
+ avctx->has_b_frames= 1; // not true, but DP frames and these behave like unidirectional b frames
s->flags= avctx->flags;
if (MPV_common_init(s) < 0) return -1;
return 0;