Commit 0fd90455 authored by Michael Niedermayer's avatar Michael Niedermayer

uvlinesize

export has_b_frames
mb_skip with more than 2 ip buffers

Originally committed as revision 762 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent cd141f4c
......@@ -5,8 +5,8 @@
#define LIBAVCODEC_VERSION_INT 0x000406
#define LIBAVCODEC_VERSION "0.4.6"
#define LIBAVCODEC_BUILD 4616
#define LIBAVCODEC_BUILD_STR "4616"
#define LIBAVCODEC_BUILD 4617
#define LIBAVCODEC_BUILD_STR "4617"
enum CodecID {
CODEC_ID_NONE,
......@@ -260,6 +260,10 @@ typedef struct AVCodecContext {
void *dr_opaque_frame;
void (*get_buffer_callback)(struct AVCodecContext *c, int width, int height, int pict_type);
int has_b_frames; // is 1 if the decoded stream contains b frames
int dr_uvstride;
int dr_ip_buffer_count;
//FIXME this should be reordered after kabis API is finished ...
/*
Note: Below are located reserved fields for further usage
......@@ -282,7 +286,7 @@ typedef struct AVCodecContext {
ul_res0,ul_res1,ul_res2,ul_res3,ul_res4,ul_res5,
ul_res6,ul_res7,ul_res8,ul_res9,ul_res10,ul_res11,ul_res12;
unsigned int
ui_res0,ui_res1,ui_res2,ui_res3,ui_res4,ui_res5;
ui_res0,ui_res1,ui_res2;
unsigned short int
us_res0,us_res1,us_res2,us_res3,us_res4,us_res5,
us_res6,us_res7,us_res8,us_res9,us_res10,us_res11,us_res12;
......
......@@ -154,6 +154,7 @@ uint64_t time= rdtsc();
} else {
ret = h263_decode_picture_header(s);
}
avctx->has_b_frames= s->has_b_frames;
/* After H263 & mpeg4 header decode we have the height, width,*/
......@@ -432,8 +433,8 @@ uint64_t time= rdtsc();
pict->data[2] = s->last_picture[2];
}
pict->linesize[0] = s->linesize;
pict->linesize[1] = s->linesize / 2;
pict->linesize[2] = s->linesize / 2;
pict->linesize[1] = s->uvlinesize;
pict->linesize[2] = s->uvlinesize;
avctx->quality = s->qscale;
......
......@@ -1505,8 +1505,8 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
pict->data[1] = picture[1];
pict->data[2] = picture[2];
pict->linesize[0] = s->linesize;
pict->linesize[1] = s->linesize / 2;
pict->linesize[2] = s->linesize / 2;
pict->linesize[1] = s->uvlinesize;
pict->linesize[2] = s->uvlinesize;
return 1;
} else {
return 0;
......@@ -1546,7 +1546,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
}
s->width = width;
s->height = height;
s->has_b_frames = 1;
avctx->has_b_frames= s->has_b_frames = 1;
s->avctx = avctx;
avctx->width = width;
avctx->height = height;
......@@ -1642,8 +1642,8 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
picture->data[1] = s2->next_picture[1];
picture->data[2] = s2->next_picture[2];
picture->linesize[0] = s2->linesize;
picture->linesize[1] = s2->linesize / 2;
picture->linesize[2] = s2->linesize / 2;
picture->linesize[1] = s2->uvlinesize;
picture->linesize[2] = s2->uvlinesize;
*data_size = sizeof(AVPicture);
}
return 0;
......
This diff is collapsed.
......@@ -132,6 +132,7 @@ typedef struct MpegEncContext {
int mb_width, mb_height; /* number of MBs horizontally & vertically */
int mb_num; /* number of MBs of a picture */
int linesize; /* line size, in bytes, may be different from width */
int uvlinesize; /* line size, for chroma in bytes, may be different from width */
UINT8 *new_picture[3]; /* picture to be compressed */
UINT8 *picture_buffer[REORDER_BUFFER_SIZE][3]; /* internal buffers used for reordering of input pictures */
int picture_buffer_index;
......@@ -145,6 +146,7 @@ typedef struct MpegEncContext {
UINT8 *current_picture[3]; /* buffer to store the decompressed current picture */
void *last_dr_opaque;
void *next_dr_opaque;
int ip_buffer_count; /* number of buffers, currently only >2 if dr1 is used */
int num_available_buffers; /* is 0 at the start & after seeking, after the first I frame its 1 after next I/P 2 */
int last_dc[3]; /* last DC values for MPEG1 */
INT16 *dc_val[3]; /* used for mpeg4 DC prediction, all 3 arrays must be continuous */
......@@ -340,6 +342,8 @@ typedef struct MpegEncContext {
int quant_precision;
int quarter_sample; /* 1->qpel, 0->half pel ME/MC */
int scalability;
int hierachy_type;
int enhancement_type;
int new_pred;
int reduced_res_vop;
int aspect_ratio_info;
......
......@@ -763,7 +763,7 @@ static inline int msmpeg4_pred_dc(MpegEncContext * s, int n,
wrap= s->linesize;
dest= s->current_picture[0] + (((n>>1) + 2*s->mb_y) * 8* wrap ) + ((n&1) + 2*s->mb_x) * 8;
}else{
wrap= s->linesize>>1;
wrap= s->uvlinesize;
dest= s->current_picture[n-3] + (s->mb_y * 8 * wrap) + s->mb_x * 8;
}
if(s->mb_x==0) a= (1024 + (scale>>1))/scale;
......
......@@ -487,8 +487,8 @@ static int rv10_decode_frame(AVCodecContext *avctx,
pict->data[1] = s->current_picture[1];
pict->data[2] = s->current_picture[2];
pict->linesize[0] = s->linesize;
pict->linesize[1] = s->linesize / 2;
pict->linesize[2] = s->linesize / 2;
pict->linesize[1] = s->uvlinesize;
pict->linesize[2] = s->uvlinesize;
avctx->quality = s->qscale;
*data_size = sizeof(AVPicture);
......
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