Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
x264
Commits
ed61d8ee
Commit
ed61d8ee
authored
Aug 13, 2004
by
Måns Rullgård
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix.
git-svn-id:
svn://svn.videolan.org/x264/trunk@28
df754926-b1dd-0310-bc7b-ec298dee348c
parent
6b20e508
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
38 deletions
+39
-38
encoder/set.c
encoder/set.c
+39
-38
No files found.
encoder/set.c
View file @
ed61d8ee
...
...
@@ -152,9 +152,10 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
if
(
param
->
i_fps_num
>
0
&&
param
->
i_fps_den
>
0
)
{
sps
->
vui
.
b_timing_info_present
=
1
;
/* The standard is confusing me, but this seems to work best
with other encoders */
sps
->
vui
.
i_num_units_in_tick
=
param
->
i_fps_den
;
/* only frame pictures supported for now, so double time_scale */
sps
->
vui
.
i_time_scale
=
param
->
i_fps_num
*
2
;
sps
->
vui
.
i_time_scale
=
param
->
i_fps_num
;
sps
->
vui
.
b_fixed_frame_rate
=
1
;
}
sps
->
b_vui
|=
sps
->
vui
.
b_timing_info_present
;
...
...
@@ -216,42 +217,34 @@ void x264_sps_write( bs_t *s, x264_sps_t *sps )
bs_write
(
s
,
1
,
sps
->
b_vui
);
if
(
sps
->
b_vui
)
{
bs_write1
(
s
,
sps
->
vui
.
b_aspect_ratio_info_present
);
if
(
sps
->
vui
.
b_aspect_ratio_info_present
)
{
int
i
;
static
const
struct
{
int
w
,
h
;
int
sar
;
}
sar
[]
=
bs_write1
(
s
,
sps
->
vui
.
b_aspect_ratio_info_present
);
if
(
sps
->
vui
.
b_aspect_ratio_info_present
)
{
int
i
;
static
const
struct
{
int
w
,
h
;
int
sar
;
}
sar
[]
=
{
{
1
,
1
,
1
},
{
12
,
11
,
2
},
{
10
,
11
,
3
},
{
16
,
11
,
4
},
{
40
,
33
,
5
},
{
24
,
11
,
6
},
{
20
,
11
,
7
},
{
32
,
11
,
8
},
{
80
,
33
,
9
},
{
18
,
11
,
10
},
{
15
,
11
,
11
},
{
64
,
33
,
12
},
{
160
,
99
,
13
},
{
0
,
0
,
-
1
}
};
for
(
i
=
0
;
sar
[
i
].
sar
!=
-
1
;
i
++
)
{
if
(
sar
[
i
].
w
==
sps
->
vui
.
i_sar_width
&&
sar
[
i
].
h
==
sps
->
vui
.
i_sar_height
)
break
;
}
if
(
sar
[
i
].
sar
!=
-
1
)
{
bs_write
(
s
,
8
,
sar
[
i
].
sar
);
}
else
{
{
1
,
1
,
1
},
{
12
,
11
,
2
},
{
10
,
11
,
3
},
{
16
,
11
,
4
},
{
40
,
33
,
5
},
{
24
,
11
,
6
},
{
20
,
11
,
7
},
{
32
,
11
,
8
},
{
80
,
33
,
9
},
{
18
,
11
,
10
},
{
15
,
11
,
11
},
{
64
,
33
,
12
},
{
160
,
99
,
13
},
{
0
,
0
,
-
1
}
};
for
(
i
=
0
;
sar
[
i
].
sar
!=
-
1
;
i
++
)
{
if
(
sar
[
i
].
w
==
sps
->
vui
.
i_sar_width
&&
sar
[
i
].
h
==
sps
->
vui
.
i_sar_height
)
break
;
}
if
(
sar
[
i
].
sar
!=
-
1
)
{
bs_write
(
s
,
8
,
sar
[
i
].
sar
);
}
else
{
bs_write
(
s
,
8
,
255
);
/* aspect_ration_idc (extented) */
bs_write
(
s
,
16
,
sps
->
vui
.
i_sar_width
);
bs_write
(
s
,
16
,
sps
->
vui
.
i_sar_height
);
}
}
bs_write1
(
s
,
sps
->
vui
.
b_timing_info_present
);
if
(
sps
->
vui
.
b_timing_info_present
)
{
bs_write
(
s
,
32
,
sps
->
vui
.
i_num_units_in_tick
);
bs_write
(
s
,
32
,
sps
->
vui
.
i_time_scale
);
bs_write1
(
s
,
sps
->
vui
.
b_fixed_frame_rate
);
}
bs_write
(
s
,
8
,
255
);
/* aspect_ration_idc (extented) */
bs_write
(
s
,
16
,
sps
->
vui
.
i_sar_width
);
bs_write
(
s
,
16
,
sps
->
vui
.
i_sar_height
);
}
}
bs_write1
(
s
,
0
);
/* overscan_info_present_flag */
...
...
@@ -262,7 +255,15 @@ void x264_sps_write( bs_t *s, x264_sps_t *sps )
bs_write1( s, 0 ); /* colour description present flag */
#endif
bs_write1
(
s
,
0
);
/* chroma_loc_info_present_flag */
bs_write1
(
s
,
0
);
/* timing_info_present_flag */
bs_write1
(
s
,
sps
->
vui
.
b_timing_info_present
);
if
(
sps
->
vui
.
b_timing_info_present
)
{
bs_write
(
s
,
32
,
sps
->
vui
.
i_num_units_in_tick
);
bs_write
(
s
,
32
,
sps
->
vui
.
i_time_scale
);
bs_write1
(
s
,
sps
->
vui
.
b_fixed_frame_rate
);
}
bs_write1
(
s
,
0
);
/* nal_hrd_parameters_present_flag */
bs_write1
(
s
,
0
);
/* vcl_hrd_parameters_present_flag */
bs_write1
(
s
,
0
);
/* pic_struct_present_flag */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment