Skip to content

Commit c7fc06c

Browse files
committed
hevc: Change the assumption of time_scale.
HM uses time_scale in frame level. So we follow what HM does.
1 parent 28b5ed4 commit c7fc06c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

hevc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static int hevc_parse_sps_minimally
900900
else
901901
{
902902
sps->vui.num_units_in_tick = 1; /* arbitrary */
903-
sps->vui.time_scale = 50; /* arbitrary */
903+
sps->vui.time_scale = 25; /* arbitrary */
904904
}
905905
if( lsmash_bits_get( bits, 1 ) ) /* bitstream_restriction_flag */
906906
{
@@ -927,7 +927,7 @@ static int hevc_parse_sps_minimally
927927
sps->vui.frame_field_info_present_flag = sps->ptl.general.progressive_source_flag
928928
&& sps->ptl.general.interlaced_source_flag;
929929
sps->vui.num_units_in_tick = 1; /* arbitrary */
930-
sps->vui.time_scale = 50; /* arbitrary */
930+
sps->vui.time_scale = 25; /* arbitrary */
931931
sps->vui.min_spatial_segmentation_idc = 0;
932932
}
933933
return bits->bs->error ? -1 : 0;

importer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,6 +3898,9 @@ static int hevc_importer_probe( importer_t *importer )
38983898
&importer_info->composition_reordering_present,
38993899
&importer_info->last_delta,
39003900
max_composition_delay, num_access_units );
3901+
summary->timescale *= 2; /* We assume that picture timing is in field level.
3902+
* For HEVC, it seems time_scale is set in frame level basically.
3903+
* So multiply by 2 for reducing timebase and timescale. */
39013904
nalu_reduce_timescale( timestamp, npt, &importer_info->last_delta, &summary->timescale, num_access_units );
39023905
lsmash_free( npt );
39033906
importer_info->ts_list.sample_count = num_access_units;

0 commit comments

Comments
 (0)