mpeg2videodec: fix list of supported frame rates to include sane ext rates.

This only adds a subset of the frame rates that can be stored, a full list
would be more than 500 entries. Such full list could (and should) be added
if it has a usecase but the number of users of even the now added rates
seem rather small.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-05 02:51:19 +02:00
parent 66a4ac5182
commit cf5a98b9e3
3 changed files with 68 additions and 1 deletions

View File

@ -325,6 +325,72 @@ const AVRational avpriv_frame_rate_tab[16] = {
{ 0, 0},
};
const AVRational ff_mpeg2_frame_rate_tab[] = {
{ 1, 1},
{ 2, 1},
{ 3, 1},
{ 4, 1},
{ 5, 1},
{ 6, 1},
{ 8, 1},
{ 9, 1},
{ 10, 1},
{ 12, 1},
{ 15, 1},
{ 16, 1},
{ 18, 1},
{ 20, 1},
{ 24, 1},
{ 25, 1},
{ 30, 1},
{ 32, 1},
{ 36, 1},
{ 40, 1},
{ 45, 1},
{ 48, 1},
{ 50, 1},
{ 60, 1},
{ 72, 1},
{ 75, 1},
{ 80, 1},
{ 90, 1},
{ 96, 1},
{ 100, 1},
{ 120, 1},
{ 150, 1},
{ 180, 1},
{ 200, 1},
{ 240, 1},
{ 750, 1001},
{ 800, 1001},
{ 960, 1001},
{ 1000, 1001},
{ 1200, 1001},
{ 1250, 1001},
{ 1500, 1001},
{ 1600, 1001},
{ 1875, 1001},
{ 2000, 1001},
{ 2400, 1001},
{ 2500, 1001},
{ 3000, 1001},
{ 3750, 1001},
{ 4000, 1001},
{ 4800, 1001},
{ 5000, 1001},
{ 6000, 1001},
{ 7500, 1001},
{ 8000, 1001},
{ 10000, 1001},
{ 12000, 1001},
{ 15000, 1001},
{ 20000, 1001},
{ 24000, 1001},
{ 30000, 1001},
{ 60000, 1001},
{ 0, 0},
};
const float ff_mpeg1_aspect[16]={
0.0000,
1.0000,

View File

@ -49,6 +49,7 @@ extern const uint8_t ff_mpeg12_mbPatTable[64][2];
extern const uint8_t ff_mpeg12_mbMotionVectorTable[17][2];
extern const AVRational avpriv_frame_rate_tab[];
extern const AVRational ff_mpeg2_frame_rate_tab[];
extern const float ff_mpeg1_aspect[16];
extern const AVRational ff_mpeg2_aspect[16];

View File

@ -998,7 +998,7 @@ AVCodec ff_mpeg2video_encoder = {
.init = encode_init,
.encode2 = ff_MPV_encode_picture,
.close = ff_MPV_encode_end,
.supported_framerates = avpriv_frame_rate_tab + 1,
.supported_framerates = ff_mpeg2_frame_rate_tab,
.pix_fmts = (const enum PixelFormat[]){
PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE
},