Commit a52b8c38 authored by michaelni's avatar michaelni

uvlinesize

export has_b_frames
mb_skip with more than 2 ip buffers


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@762 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 80ce48b9
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#define LIBAVCODEC_VERSION_INT 0x000406 #define LIBAVCODEC_VERSION_INT 0x000406
#define LIBAVCODEC_VERSION "0.4.6" #define LIBAVCODEC_VERSION "0.4.6"
#define LIBAVCODEC_BUILD 4616 #define LIBAVCODEC_BUILD 4617
#define LIBAVCODEC_BUILD_STR "4616" #define LIBAVCODEC_BUILD_STR "4617"
enum CodecID { enum CodecID {
CODEC_ID_NONE, CODEC_ID_NONE,
...@@ -258,7 +258,11 @@ typedef struct AVCodecContext { ...@@ -258,7 +258,11 @@ typedef struct AVCodecContext {
uint8_t *dr_buffer[3]; uint8_t *dr_buffer[3];
int dr_stride; int dr_stride;
void *dr_opaque_frame; void *dr_opaque_frame;
void (*get_buffer_callback)(struct AVCodecContext *c, int width, int height, int pict_type); 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 ... //FIXME this should be reordered after kabis API is finished ...
/* /*
...@@ -282,13 +286,13 @@ typedef struct AVCodecContext { ...@@ -282,13 +286,13 @@ typedef struct AVCodecContext {
ul_res0,ul_res1,ul_res2,ul_res3,ul_res4,ul_res5, 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; ul_res6,ul_res7,ul_res8,ul_res9,ul_res10,ul_res11,ul_res12;
unsigned int unsigned int
ui_res0,ui_res1,ui_res2,ui_res3,ui_res4,ui_res5; ui_res0,ui_res1,ui_res2;
unsigned short int unsigned short int
us_res0,us_res1,us_res2,us_res3,us_res4,us_res5, 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; us_res6,us_res7,us_res8,us_res9,us_res10,us_res11,us_res12;
unsigned char unsigned char
uc_res0,uc_res1,uc_res2,uc_res3,uc_res4,uc_res5, uc_res0,uc_res1,uc_res2,uc_res3,uc_res4,uc_res5,
uc_res6,uc_res7,uc_res8,uc_res9,uc_res10,uc_res11,uc_res12; uc_res6,uc_res7,uc_res8,uc_res9,uc_res10,uc_res11,uc_res12;
} AVCodecContext; } AVCodecContext;
typedef struct AVCodec { typedef struct AVCodec {
...@@ -299,7 +303,7 @@ typedef struct AVCodec { ...@@ -299,7 +303,7 @@ typedef struct AVCodec {
int (*init)(AVCodecContext *); int (*init)(AVCodecContext *);
int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data); int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data);
int (*close)(AVCodecContext *); int (*close)(AVCodecContext *);
int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
UINT8 *buf, int buf_size); UINT8 *buf, int buf_size);
int capabilities; int capabilities;
struct AVCodec *next; struct AVCodec *next;
......
...@@ -154,6 +154,7 @@ uint64_t time= rdtsc(); ...@@ -154,6 +154,7 @@ uint64_t time= rdtsc();
} else { } else {
ret = h263_decode_picture_header(s); ret = h263_decode_picture_header(s);
} }
avctx->has_b_frames= s->has_b_frames;
/* After H263 & mpeg4 header decode we have the height, width,*/ /* After H263 & mpeg4 header decode we have the height, width,*/
...@@ -432,8 +433,8 @@ uint64_t time= rdtsc(); ...@@ -432,8 +433,8 @@ uint64_t time= rdtsc();
pict->data[2] = s->last_picture[2]; pict->data[2] = s->last_picture[2];
} }
pict->linesize[0] = s->linesize; pict->linesize[0] = s->linesize;
pict->linesize[1] = s->linesize / 2; pict->linesize[1] = s->uvlinesize;
pict->linesize[2] = s->linesize / 2; pict->linesize[2] = s->uvlinesize;
avctx->quality = s->qscale; avctx->quality = s->qscale;
......
...@@ -1505,8 +1505,8 @@ static int mpeg_decode_slice(AVCodecContext *avctx, ...@@ -1505,8 +1505,8 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
pict->data[1] = picture[1]; pict->data[1] = picture[1];
pict->data[2] = picture[2]; pict->data[2] = picture[2];
pict->linesize[0] = s->linesize; pict->linesize[0] = s->linesize;
pict->linesize[1] = s->linesize / 2; pict->linesize[1] = s->uvlinesize;
pict->linesize[2] = s->linesize / 2; pict->linesize[2] = s->uvlinesize;
return 1; return 1;
} else { } else {
return 0; return 0;
...@@ -1546,7 +1546,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, ...@@ -1546,7 +1546,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
} }
s->width = width; s->width = width;
s->height = height; s->height = height;
s->has_b_frames = 1; avctx->has_b_frames= s->has_b_frames = 1;
s->avctx = avctx; s->avctx = avctx;
avctx->width = width; avctx->width = width;
avctx->height = height; avctx->height = height;
...@@ -1642,8 +1642,8 @@ static int mpeg_decode_frame(AVCodecContext *avctx, ...@@ -1642,8 +1642,8 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
picture->data[1] = s2->next_picture[1]; picture->data[1] = s2->next_picture[1];
picture->data[2] = s2->next_picture[2]; picture->data[2] = s2->next_picture[2];
picture->linesize[0] = s2->linesize; picture->linesize[0] = s2->linesize;
picture->linesize[1] = s2->linesize / 2; picture->linesize[1] = s2->uvlinesize;
picture->linesize[2] = s2->linesize / 2; picture->linesize[2] = s2->uvlinesize;
*data_size = sizeof(AVPicture); *data_size = sizeof(AVPicture);
} }
return 0; return 0;
......
This diff is collapsed.
...@@ -132,6 +132,7 @@ typedef struct MpegEncContext { ...@@ -132,6 +132,7 @@ typedef struct MpegEncContext {
int mb_width, mb_height; /* number of MBs horizontally & vertically */ int mb_width, mb_height; /* number of MBs horizontally & vertically */
int mb_num; /* number of MBs of a picture */ int mb_num; /* number of MBs of a picture */
int linesize; /* line size, in bytes, may be different from width */ 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 *new_picture[3]; /* picture to be compressed */
UINT8 *picture_buffer[REORDER_BUFFER_SIZE][3]; /* internal buffers used for reordering of input pictures */ UINT8 *picture_buffer[REORDER_BUFFER_SIZE][3]; /* internal buffers used for reordering of input pictures */
int picture_buffer_index; int picture_buffer_index;
...@@ -145,6 +146,7 @@ typedef struct MpegEncContext { ...@@ -145,6 +146,7 @@ typedef struct MpegEncContext {
UINT8 *current_picture[3]; /* buffer to store the decompressed current picture */ UINT8 *current_picture[3]; /* buffer to store the decompressed current picture */
void *last_dr_opaque; void *last_dr_opaque;
void *next_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 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 */ int last_dc[3]; /* last DC values for MPEG1 */
INT16 *dc_val[3]; /* used for mpeg4 DC prediction, all 3 arrays must be continuous */ INT16 *dc_val[3]; /* used for mpeg4 DC prediction, all 3 arrays must be continuous */
...@@ -340,6 +342,8 @@ typedef struct MpegEncContext { ...@@ -340,6 +342,8 @@ typedef struct MpegEncContext {
int quant_precision; int quant_precision;
int quarter_sample; /* 1->qpel, 0->half pel ME/MC */ int quarter_sample; /* 1->qpel, 0->half pel ME/MC */
int scalability; int scalability;
int hierachy_type;
int enhancement_type;
int new_pred; int new_pred;
int reduced_res_vop; int reduced_res_vop;
int aspect_ratio_info; int aspect_ratio_info;
......
...@@ -763,7 +763,7 @@ static inline int msmpeg4_pred_dc(MpegEncContext * s, int n, ...@@ -763,7 +763,7 @@ static inline int msmpeg4_pred_dc(MpegEncContext * s, int n,
wrap= s->linesize; wrap= s->linesize;
dest= s->current_picture[0] + (((n>>1) + 2*s->mb_y) * 8* wrap ) + ((n&1) + 2*s->mb_x) * 8; dest= s->current_picture[0] + (((n>>1) + 2*s->mb_y) * 8* wrap ) + ((n&1) + 2*s->mb_x) * 8;
}else{ }else{
wrap= s->linesize>>1; wrap= s->uvlinesize;
dest= s->current_picture[n-3] + (s->mb_y * 8 * wrap) + s->mb_x * 8; 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; if(s->mb_x==0) a= (1024 + (scale>>1))/scale;
......
...@@ -487,8 +487,8 @@ static int rv10_decode_frame(AVCodecContext *avctx, ...@@ -487,8 +487,8 @@ static int rv10_decode_frame(AVCodecContext *avctx,
pict->data[1] = s->current_picture[1]; pict->data[1] = s->current_picture[1];
pict->data[2] = s->current_picture[2]; pict->data[2] = s->current_picture[2];
pict->linesize[0] = s->linesize; pict->linesize[0] = s->linesize;
pict->linesize[1] = s->linesize / 2; pict->linesize[1] = s->uvlinesize;
pict->linesize[2] = s->linesize / 2; pict->linesize[2] = s->uvlinesize;
avctx->quality = s->qscale; avctx->quality = s->qscale;
*data_size = sizeof(AVPicture); *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