#define FFMPEG_VERSION_INT 0x000409
#define FFMPEG_VERSION "0.4.9-pre1"
-#define LIBAVCODEC_BUILD 4723
+#define LIBAVCODEC_BUILD 4724
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION
MPV_decode_defaults(s);
s->avctx = avctx;
- s->width = s->avctx->width;
- s->height = s->avctx->height;
+ s->width = s->avctx->width >> avctx->lowres;
+ s->height = s->avctx->height >> avctx->lowres;
s->codec_id = s->avctx->codec->id;
s->out_format = FMT_H261;
return -1;
}
- if (s->width != avctx->width || s->height != avctx->height){
+ if (s->width >> avctx->lowres != avctx->width || s->height >> avctx->lowres != avctx->height){
ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
s->parse_context.buffer=0;
MPV_common_end(s);
s->parse_context= pc;
}
if (!s->context_initialized) {
- avctx->width = s->width;
- avctx->height = s->height;
+ avctx->width = s->width >> avctx->lowres;
+ avctx->height = s->height >> avctx->lowres;
goto retry;
}
s->avctx = avctx;
s->out_format = FMT_H263;
- s->width = avctx->width;
+ s->width = avctx->width;
s->height = avctx->height;
+ avctx->width = -((-s->width )>>avctx->lowres);
+ avctx->height= -((-s->height)>>avctx->lowres);
s->workaround_bugs= avctx->workaround_bugs;
// set defaults
/* FIXME: By the way H263 decoder is evolving it should have */
/* an H263EncContext */
- if ( s->width != avctx->width || s->height != avctx->height) {
+ if ( -((-s->width )>>avctx->lowres) != avctx->width
+ || -((-s->height)>>avctx->lowres) != avctx->height) {
/* H.263 could change picture size any time */
ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
s->parse_context.buffer=0;
s->parse_context= pc;
}
if (!s->context_initialized) {
- avctx->width = s->width;
- avctx->height = s->height;
+ avctx->width = -((-s->width)>>avctx->lowres);
+ avctx->height = -((-s->height)>>avctx->lowres);
goto retry;
}
MpegEncContext s2;
s->avctx = avctx;
+ avctx->width = -((-avctx->width )) >> avctx->lowres;
+ avctx->height= -((-avctx->height)) >> avctx->lowres;
/* ugly way to get the idct & scantable FIXME */
memset(&s2, 0, sizeof(MpegEncContext));
return -1;
s->start_code = -1;
s->first_picture = 1;
- s->org_height = avctx->height;
+ s->org_height = avctx->height << avctx->lowres;
build_vlc(&s->vlcs[0][0], bits_dc_luminance, val_dc_luminance, 12);
build_vlc(&s->vlcs[0][1], bits_dc_chrominance, val_dc_chrominance, 12);
s->width = width;
s->height = height;
- s->avctx->width = s->width;
- s->avctx->height = s->height;
+ s->avctx->width = -((-s->width )>>s->avctx->lowres);
+ s->avctx->height = -((-s->height)>>s->avctx->lowres);
/* test interlaced mode */
if (s->first_picture &&
j += sizeof(sp5x_data_dht);
memcpy(recoded+j, &sp5x_data_sof[0], sizeof(sp5x_data_sof));
- recoded[j+5] = (avctx->height >> 8) & 0xFF;
+ recoded[j+5] = (avctx->height >> 8) & 0xFF; //FIXME lowres
recoded[j+6] = avctx->height & 0xFF;
recoded[j+7] = (avctx->width >> 8) & 0xFF;
recoded[j+8] = avctx->width & 0xFF;
#else
/* SOF */
s->bits = 8;
- s->width = avctx->width;
- s->height = avctx->height;
+ s->width = avctx->width << avctx->lowres;
+ s->height = avctx->height<< avctx->lowres;
s->nb_components = 3;
s->component_id[0] = 0;
s->h_count[0] = 2;
if (
(s1->mpeg_enc_ctx_allocated == 0)||
- avctx->width != s->width ||
- avctx->height != s->height||
+ avctx->width != -((-s->width )>>avctx->lowres) ||
+ avctx->height != -((-s->height)>>avctx->lowres) ||
// s1->save_aspect_info != avctx->aspect_ratio_info||
0)
{
if( (s->width == 0 )||(s->height == 0))
return -2;
- avctx->width = s->width;
- avctx->height = s->height;
+ avctx->width = -((-s->width )>>avctx->lowres);
+ avctx->height = -((-s->height)>>avctx->lowres);
avctx->bit_rate = s->bit_rate;
s1->save_aspect_info = s->aspect_ratio_info;
uint8_t *ptr;
int i;
int h_chroma_shift, v_chroma_shift;
+ const int width = s->avctx->width;
+ const int height= s->avctx->height;
s->low_delay=0; //needed to see the vectors without trashing the buffers
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift);
for(i=0; i<3; i++){
- memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*s->height:pict->linesize[i]*s->height >> v_chroma_shift);
+ memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*height:pict->linesize[i]*height >> v_chroma_shift);
pict->data[i]= s->visualization_buffer[i];
}
pict->type= FF_BUFFER_TYPE_COPY;
int xy= mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*s->b8_stride;
int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
- draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100);
+ draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
}
}else if(IS_16X8(pict->mb_type[mb_index])){
int i;
if(IS_INTERLACED(pict->mb_type[mb_index]))
my*=2;
- draw_arrow(ptr, sx, sy, mx+sx, my+sy, s->width, s->height, s->linesize, 100);
+ draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
}
}else{
int sx= mb_x*16 + 8;
int xy= mb_x*2 + mb_y*2*s->b8_stride;
int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
- draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100);
+ draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
}
}
}
if(s->first_field && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
}
- h= FFMIN(h, (s->height>>s->avctx->lowres) - y);
+ h= FFMIN(h, s->avctx->height - y);
if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
src= (AVFrame*)s->current_picture_ptr;