Browse Source

get_format()

Originally committed as revision 1451 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 22 years ago
parent
commit
a33c7159e1
4 changed files with 18 additions and 0 deletions
  1. +10
    -0
      libavcodec/avcodec.h
  2. +2
    -0
      libavcodec/mpegvideo.c
  3. +1
    -0
      libavcodec/mpegvideo.h
  4. +5
    -0
      libavcodec/utils.c

+ 10
- 0
libavcodec/avcodec.h View File

@@ -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 {


+ 2
- 0
libavcodec/mpegvideo.c View File

@@ -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)
{


+ 1
- 0
libavcodec/mpegvideo.h View File

@@ -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;



+ 5
- 0
libavcodec/utils.c View File

@@ -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;
}



Loading…
Cancel
Save