Projects
Multimedia
avidemux3
libavcodec_mpeg12enc.c.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libavcodec_mpeg12enc.c.patch of Package avidemux3 (Revision 19)
Currently displaying revision
19
,
Show latest
--- libavcodec/mpeg12enc.c.orig 2015-09-10 16:03:12.576365227 +0200 +++ libavcodec/mpeg12enc.c 2015-09-10 16:03:12.615365537 +0200 @@ -256,6 +256,7 @@ put_sbits(&s->pb, 12, s->width & 0xFFF); put_sbits(&s->pb, 12, s->height & 0xFFF); +#if 0 // MEANX for (i = 1; i < 15; i++) { int64_t error = aspect_ratio.num * (1LL<<32) / aspect_ratio.den; if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO || i <= 1) @@ -271,11 +272,40 @@ } } - put_bits(&s->pb, 4, s->aspect_ratio_info); - put_bits(&s->pb, 4, s->frame_rate_index); - - if (s->avctx->rc_max_rate) { - v = (s->avctx->rc_max_rate + 399) / 400; +#endif // MEANX + // MEANX put_bits(&s->pb, 4, s->aspect_ratio_info); + // MEANX put_bits(&s->pb, 4, s->frame_rate_index); + // MEANX 4:3 + if(s->avctx->sample_aspect_ratio.num==16 && s->avctx->sample_aspect_ratio.den==9) + { + //printf("FFmpeg : Wide\n"); + put_bits(&s->pb,4,3); //16:9 + } + else //4:3 + { + if(s->codec_id == CODEC_ID_MPEG2VIDEO) + put_bits(&s->pb, 4, 2); + else + put_bits(&s->pb, 4, 12); // MPEG1 + } + // /MEANX +// MEANX : Pulldown + if((s->avctx->flags2 & CODEC_FLAG2_32_PULLDOWN) && (s->codec_id == CODEC_ID_MPEG2VIDEO)) + { + put_bits(&s->pb, 4,4); + } + else + { + put_bits(&s->pb, 4, s->frame_rate_index); + } //MEANX pulldown + + // MEANX if(s->avctx->rc_max_rate){ + // MEANX v = (s->avctx->rc_max_rate + 399) / 400; + // MEANX if(s->avctx->rc_max_rate_header){ //MEANX we use header + // MEANX v = (s->avctx->rc_max_rate_header + 399) / 400; + if(s->avctx->rc_buffer_size_header) // MEANX we use header + { + vbv_buffer_size = s->avctx->rc_buffer_size_header; if (v > 0x3ffff && s->codec_id == AV_CODEC_ID_MPEG1VIDEO) v = 0x3ffff; } else { @@ -325,7 +355,19 @@ put_bits(&s->pb, 3, s->avctx->profile); // profile put_bits(&s->pb, 4, s->avctx->level); // level - put_bits(&s->pb, 1, s->progressive_sequence); + // MEANX pulldown put_bits(&s->pb, 1, s->progressive_sequence); + // MEANX Pulldown + if(s->avctx->flags2 & CODEC_FLAG2_32_PULLDOWN) //MEANX + put_bits(&s->pb, 1, 0); + else + put_bits(&s->pb, 1, s->progressive_sequence); + + +// /MEANX + + + +// MEANX put_bits(&s->pb, 1, s->progressive_sequence); put_bits(&s->pb, 2, s->chroma_format); put_bits(&s->pb, 2, s->width >> 12); put_bits(&s->pb, 2, s->height >> 12); @@ -427,6 +469,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) { + int tff, rff; //MEANX AVFrameSideData *side_data; mpeg1_encode_sequence_header(s); @@ -465,6 +508,46 @@ s->frame_pred_frame_dct = 1; if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) { +// MEANX + if(s->avctx->flags2 & CODEC_FLAG2_32_PULLDOWN) + { + + switch((s->picture_number - + s->gop_picture_number)&3) + { + case 0: + default: + rff=1; + tff=1; + break; + case 1: + rff=0; + tff=0; + break; + case 2: + rff=1; + tff=0; + break; + case 3: + rff=0; + tff=1; + break; + } + } + else + { + if (s->progressive_sequence) + { + tff=0; /* no repeat */ + } else + { + tff=s->current_picture_ptr->f->top_field_first; + } + rff=s->repeat_first_field; + + } + +// /MEANX put_header(s, EXT_START_CODE); put_bits(&s->pb, 4, 8); /* pic ext */ if (s->pict_type == AV_PICTURE_TYPE_P || @@ -484,10 +567,14 @@ av_assert0(s->picture_structure == PICT_FRAME); put_bits(&s->pb, 2, s->picture_structure); +#if 0 // MEANX if (s->progressive_sequence) put_bits(&s->pb, 1, 0); /* no repeat */ else put_bits(&s->pb, 1, s->current_picture_ptr->f->top_field_first); +#endif // MEANX + put_bits(&s->pb, 1, tff); //MEANX PULLDOWN + /* XXX: optimize the generation of this flag with entropy measures */ s->frame_pred_frame_dct = s->progressive_sequence; @@ -496,7 +583,8 @@ put_bits(&s->pb, 1, s->q_scale_type); put_bits(&s->pb, 1, s->intra_vlc_format); put_bits(&s->pb, 1, s->alternate_scan); - put_bits(&s->pb, 1, s->repeat_first_field); + // MEANX put_bits(&s->pb, 1, s->top_field_first); + put_bits(&s->pb, 1, rff); // MEANX s->progressive_frame = s->progressive_sequence; /* chroma_420_type */ put_bits(&s->pb, 1, s->chroma_format ==
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.