summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-01-12 00:48:29 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-01-12 00:48:29 +0000
commita33c7159e1630ecef81c71e3f2624f09e7d2a413 (patch)
treec7bac0bfca57bc616a25aa6e0e02f43a16545587 /libavcodec
parent2a006cd3968461455c8d15640f8cec38ddfc97bb (diff)
get_format()
Originally committed as revision 1451 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h10
-rw-r--r--libavcodec/mpegvideo.c2
-rw-r--r--libavcodec/mpegvideo.h1
-rw-r--r--libavcodec/utils.c5
4 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 2b36aeb8c1..72d6d32efb 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -923,6 +923,16 @@ typedef struct AVCodecContext {
*/
int me_subpel_quality;
+ /**
+ * callback to negotiate the pixelFormat
+ * @param fmt is the list of formats which are supported by the codec,
+ * its terminated by -1 as 0 is a valid format, the formats are ordered by quality
+ * the first is allways the native one
+ * @return the choosen format
+ * encoding: unused
+ * decoding: set by user, if not set then the native format will always be choosen
+ */
+ enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt);
} AVCodecContext;
typedef struct AVCodec {
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 8206df470e..c668121246 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -86,6 +86,8 @@ static const uint8_t h263_chroma_roundtab[16] = {
static UINT16 (*default_mv_penalty)[MAX_MV*2+1]=NULL;
static UINT8 default_fcode_tab[MAX_MV*2+1];
+enum PixelFormat ff_yuv420p_list[2]= {PIX_FMT_YUV420P, -1};
+
static void convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16)[64], uint16_t (*qmat16_bias)[64],
const UINT16 *quant_matrix, int bias, int qmin, int qmax)
{
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index e6909817aa..147b36a3b5 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -597,6 +597,7 @@ void ff_emulated_edge_mc(MpegEncContext *s, UINT8 *src, int linesize, int block_
int src_x, int src_y, int w, int h);
char ff_get_pict_type_char(int pict_type);
+extern enum PixelFormat ff_yuv420p_list[2];
extern int ff_bit_exact;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1b532fc94c..ba47785ffc 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -185,6 +185,10 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
//printf("R%X\n", pic->opaque);
}
+enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, enum PixelFormat * fmt){
+ return fmt[0];
+}
+
void avcodec_get_context_defaults(AVCodecContext *s){
s->bit_rate= 800*1000;
s->bit_rate_tolerance= s->bit_rate*10;
@@ -207,6 +211,7 @@ void avcodec_get_context_defaults(AVCodecContext *s){
s->me_method= ME_EPZS;
s->get_buffer= avcodec_default_get_buffer;
s->release_buffer= avcodec_default_release_buffer;
+ s->get_format= avcodec_default_get_format;
s->me_subpel_quality=8;
}