You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	Correct time_base of H.264 and repeat_pict.
Patch by Ivan Schreter, schreter gmx net Originally committed as revision 17571 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
				
					committed by
					
						 Carl Eugen Hoyos
						Carl Eugen Hoyos
					
				
			
			
				
	
			
			
			
						parent
						
							810c451b02
						
					
				
				
					commit
					fc9fe42833
				
			| @@ -3763,7 +3763,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ | |||||||
|             s->avctx->sample_aspect_ratio.den = 1; |             s->avctx->sample_aspect_ratio.den = 1; | ||||||
|  |  | ||||||
|         if(h->sps.timing_info_present_flag){ |         if(h->sps.timing_info_present_flag){ | ||||||
|             s->avctx->time_base= (AVRational){h->sps.num_units_in_tick * 2, h->sps.time_scale}; |             s->avctx->time_base= (AVRational){h->sps.num_units_in_tick, h->sps.time_scale}; | ||||||
|             if(h->x264_build > 0 && h->x264_build < 44) |             if(h->x264_build > 0 && h->x264_build < 44) | ||||||
|                 s->avctx->time_base.den *= 2; |                 s->avctx->time_base.den *= 2; | ||||||
|             av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den, |             av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den, | ||||||
|   | |||||||
| @@ -196,29 +196,29 @@ static inline int parse_nal_units(AVCodecParserContext *s, | |||||||
|                 switch (h->sei_pic_struct) { |                 switch (h->sei_pic_struct) { | ||||||
|                     case SEI_PIC_STRUCT_TOP_FIELD: |                     case SEI_PIC_STRUCT_TOP_FIELD: | ||||||
|                     case SEI_PIC_STRUCT_BOTTOM_FIELD: |                     case SEI_PIC_STRUCT_BOTTOM_FIELD: | ||||||
|                         s->repeat_pict = -1; |                         s->repeat_pict = 0; | ||||||
|                         break; |                         break; | ||||||
|                     case SEI_PIC_STRUCT_FRAME: |                     case SEI_PIC_STRUCT_FRAME: | ||||||
|                     case SEI_PIC_STRUCT_TOP_BOTTOM: |                     case SEI_PIC_STRUCT_TOP_BOTTOM: | ||||||
|                     case SEI_PIC_STRUCT_BOTTOM_TOP: |                     case SEI_PIC_STRUCT_BOTTOM_TOP: | ||||||
|                         s->repeat_pict = 0; |                         s->repeat_pict = 1; | ||||||
|                         break; |                         break; | ||||||
|                     case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: |                     case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: | ||||||
|                     case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: |                     case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: | ||||||
|                         s->repeat_pict = 1; |  | ||||||
|                         break; |  | ||||||
|                     case SEI_PIC_STRUCT_FRAME_DOUBLING: |  | ||||||
|                         s->repeat_pict = 2; |                         s->repeat_pict = 2; | ||||||
|                         break; |                         break; | ||||||
|  |                     case SEI_PIC_STRUCT_FRAME_DOUBLING: | ||||||
|  |                         s->repeat_pict = 3; | ||||||
|  |                         break; | ||||||
|                     case SEI_PIC_STRUCT_FRAME_TRIPLING: |                     case SEI_PIC_STRUCT_FRAME_TRIPLING: | ||||||
|                         s->repeat_pict = 4; |                         s->repeat_pict = 5; | ||||||
|                         break; |                         break; | ||||||
|                     default: |                     default: | ||||||
|                         s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 0 : -1; |                         s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 1 : 0; | ||||||
|                         break; |                         break; | ||||||
|                 } |                 } | ||||||
|             } else { |             } else { | ||||||
|                 s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 0 : -1; |                 s->repeat_pict = h->s.picture_structure == PICT_FRAME ? 1 : 0; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             return 0; /* no need to evaluate the rest */ |             return 0; /* no need to evaluate the rest */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user