Browse Source

avcodec: Rename avpriv_frame_rate_tab to ff_mpeg12_frame_rate_tab

This table doesn't need to be shared with libavformat any longer.
Add mpeg12 to the name to make it less ambiguous, while renaming it.

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n1.1
Martin Storsjö 13 years ago
parent
commit
eaa9b2e66c
7 changed files with 15 additions and 15 deletions
  1. +2
    -2
      libavcodec/cavsdec.c
  2. +1
    -1
      libavcodec/dirac.c
  3. +4
    -4
      libavcodec/mpeg12.c
  4. +1
    -1
      libavcodec/mpeg12data.c
  5. +1
    -1
      libavcodec/mpeg12data.h
  6. +4
    -4
      libavcodec/mpeg12enc.c
  7. +2
    -2
      libavcodec/mpegvideo_parser.c

+ 2
- 2
libavcodec/cavsdec.c View File

@@ -1081,8 +1081,8 @@ static int decode_seq_header(AVSContext *h) {
s->low_delay = get_bits1(&s->gb); s->low_delay = get_bits1(&s->gb);
h->mb_width = (s->width + 15) >> 4; h->mb_width = (s->width + 15) >> 4;
h->mb_height = (s->height + 15) >> 4; h->mb_height = (s->height + 15) >> 4;
h->s.avctx->time_base.den = avpriv_frame_rate_tab[frame_rate_code].num;
h->s.avctx->time_base.num = avpriv_frame_rate_tab[frame_rate_code].den;
h->s.avctx->time_base.den = ff_mpeg12_frame_rate_tab[frame_rate_code].num;
h->s.avctx->time_base.num = ff_mpeg12_frame_rate_tab[frame_rate_code].den;
h->s.avctx->width = s->width; h->s.avctx->width = s->width;
h->s.avctx->height = s->height; h->s.avctx->height = s->height;
if(!h->top_qp) if(!h->top_qp)


+ 1
- 1
libavcodec/dirac.c View File

@@ -165,7 +165,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
/* [DIRAC_STD] preset_frame_rate(video_params, index) */ /* [DIRAC_STD] preset_frame_rate(video_params, index) */
if (source->frame_rate_index > 0) { if (source->frame_rate_index > 0) {
if (source->frame_rate_index <= 8) if (source->frame_rate_index <= 8)
frame_rate = avpriv_frame_rate_tab[source->frame_rate_index];
frame_rate = ff_mpeg12_frame_rate_tab[source->frame_rate_index];
else else
/* [DIRAC_STD] Table 10.3 values 9-10 */ /* [DIRAC_STD] Table 10.3 values 9-10 */
frame_rate = dirac_frame_rate[source->frame_rate_index-9]; frame_rate = dirac_frame_rate[source->frame_rate_index-9];


+ 4
- 4
libavcodec/mpeg12.c View File

@@ -1239,8 +1239,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)


if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) { if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
//MPEG-1 fps //MPEG-1 fps
avctx->time_base.den = avpriv_frame_rate_tab[s->frame_rate_index].num;
avctx->time_base.num = avpriv_frame_rate_tab[s->frame_rate_index].den;
avctx->time_base.den = ff_mpeg12_frame_rate_tab[s->frame_rate_index].num;
avctx->time_base.num = ff_mpeg12_frame_rate_tab[s->frame_rate_index].den;
//MPEG-1 aspect //MPEG-1 aspect
avctx->sample_aspect_ratio = av_d2q(1.0/ff_mpeg1_aspect[s->aspect_ratio_info], 255); avctx->sample_aspect_ratio = av_d2q(1.0/ff_mpeg1_aspect[s->aspect_ratio_info], 255);
avctx->ticks_per_frame=1; avctx->ticks_per_frame=1;
@@ -1248,8 +1248,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
//MPEG-2 fps //MPEG-2 fps
av_reduce(&s->avctx->time_base.den, av_reduce(&s->avctx->time_base.den,
&s->avctx->time_base.num, &s->avctx->time_base.num,
avpriv_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num*2,
avpriv_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den,
ff_mpeg12_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num*2,
ff_mpeg12_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den,
1 << 30); 1 << 30);
avctx->ticks_per_frame = 2; avctx->ticks_per_frame = 2;
//MPEG-2 aspect //MPEG-2 aspect


+ 1
- 1
libavcodec/mpeg12data.c View File

@@ -305,7 +305,7 @@ const uint8_t ff_mpeg12_mbMotionVectorTable[17][2] = {
{ 0xc, 10 }, { 0xc, 10 },
}; };


const AVRational avpriv_frame_rate_tab[16] = {
const AVRational ff_mpeg12_frame_rate_tab[16] = {
{ 0, 0}, { 0, 0},
{24000, 1001}, {24000, 1001},
{ 24, 1}, { 24, 1},


+ 1
- 1
libavcodec/mpeg12data.h View File

@@ -48,7 +48,7 @@ extern const uint8_t ff_mpeg12_mbPatTable[64][2];


extern const uint8_t ff_mpeg12_mbMotionVectorTable[17][2]; extern const uint8_t ff_mpeg12_mbMotionVectorTable[17][2];


extern const AVRational avpriv_frame_rate_tab[];
extern const AVRational ff_mpeg12_frame_rate_tab[];


extern const float ff_mpeg1_aspect[16]; extern const float ff_mpeg1_aspect[16];
extern const AVRational ff_mpeg2_aspect[16]; extern const AVRational ff_mpeg2_aspect[16];


+ 4
- 4
libavcodec/mpeg12enc.c View File

@@ -111,7 +111,7 @@ static int find_frame_rate_index(MpegEncContext *s){
int64_t d; int64_t d;


for(i=1;i<14;i++) { for(i=1;i<14;i++) {
int64_t n0= 1001LL/avpriv_frame_rate_tab[i].den*avpriv_frame_rate_tab[i].num*s->avctx->time_base.num;
int64_t n0 = 1001LL / ff_mpeg12_frame_rate_tab[i].den * ff_mpeg12_frame_rate_tab[i].num * s->avctx->time_base.num;
int64_t n1= 1001LL*s->avctx->time_base.den; int64_t n1= 1001LL*s->avctx->time_base.den;
if(s->avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL && i>=9) break; if(s->avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL && i>=9) break;


@@ -195,7 +195,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
if(aspect_ratio==0.0) aspect_ratio= 1.0; //pixel aspect 1:1 (VGA) if(aspect_ratio==0.0) aspect_ratio= 1.0; //pixel aspect 1:1 (VGA)


if (s->current_picture.f.key_frame) { if (s->current_picture.f.key_frame) {
AVRational framerate= avpriv_frame_rate_tab[s->frame_rate_index];
AVRational framerate = ff_mpeg12_frame_rate_tab[s->frame_rate_index];


/* mpeg1 header repeated every gop */ /* mpeg1 header repeated every gop */
put_header(s, SEQ_START_CODE); put_header(s, SEQ_START_CODE);
@@ -958,7 +958,7 @@ AVCodec ff_mpeg1video_encoder = {
.init = encode_init, .init = encode_init,
.encode2 = ff_MPV_encode_picture, .encode2 = ff_MPV_encode_picture,
.close = ff_MPV_encode_end, .close = ff_MPV_encode_end,
.supported_framerates = avpriv_frame_rate_tab+1,
.supported_framerates = ff_mpeg12_frame_rate_tab + 1,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE }, AV_PIX_FMT_NONE },
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
@@ -974,7 +974,7 @@ AVCodec ff_mpeg2video_encoder = {
.init = encode_init, .init = encode_init,
.encode2 = ff_MPV_encode_picture, .encode2 = ff_MPV_encode_picture,
.close = ff_MPV_encode_end, .close = ff_MPV_encode_end,
.supported_framerates = avpriv_frame_rate_tab + 1,
.supported_framerates = ff_mpeg12_frame_rate_tab + 1,
.pix_fmts = (const enum AVPixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE
}, },


+ 2
- 2
libavcodec/mpegvideo_parser.c View File

@@ -65,8 +65,8 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
did_set_size=1; did_set_size=1;
} }
frame_rate_index = buf[3] & 0xf; frame_rate_index = buf[3] & 0xf;
pc->frame_rate.den = avctx->time_base.den = avpriv_frame_rate_tab[frame_rate_index].num;
pc->frame_rate.num = avctx->time_base.num = avpriv_frame_rate_tab[frame_rate_index].den;
pc->frame_rate.den = avctx->time_base.den = ff_mpeg12_frame_rate_tab[frame_rate_index].num;
pc->frame_rate.num = avctx->time_base.num = ff_mpeg12_frame_rate_tab[frame_rate_index].den;
avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400; avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400;
avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO; avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
} }


Loading…
Cancel
Save