Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
ffmpeg2theora
Commits
bab920d1
Commit
bab920d1
authored
Aug 06, 2009
by
Jan Gerber
Browse files
pad image by offset_x/offset_y, still output square pixeled image if not upscaling
parent
1d963f26
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ffmpeg2theora.c
View file @
bab920d1
...
...
@@ -594,7 +594,9 @@ void ff2theora_output(ff2theora this) {
this
->
aspect_numerator
=
10000
*
this
->
frame_aspect
*
display_height
;
this
->
aspect_denominator
=
10000
*
display_width
;
}
av_reduce
(
&
this
->
aspect_numerator
,
&
this
->
aspect_denominator
,
this
->
aspect_numerator
,
this
->
aspect_denominator
,
10000
);
av_reduce
(
&
this
->
aspect_numerator
,
&
this
->
aspect_denominator
,
this
->
aspect_numerator
,
this
->
aspect_denominator
,
1024
*
1024
);
frame_aspect
=
this
->
frame_aspect
;
}
...
...
@@ -723,10 +725,14 @@ void ff2theora_output(ff2theora this) {
}
if
(
this
->
no_upscaling
)
{
if
(
this
->
picture_
width
&&
this
->
picture_
width
>
display_
width
)
{
this
->
picture_width
=
display_
width
;
if
(
this
->
picture_
height
&&
this
->
picture_
height
>
display_
height
)
{
this
->
picture_width
=
display_
height
*
display_aspect_ratio
.
num
/
display_aspect_ratio
.
den
;
this
->
picture_height
=
display_height
;
}
else
if
(
this
->
picture_width
&&
this
->
picture_width
>
display_width
)
{
this
->
picture_width
=
display_width
;
this
->
picture_height
=
display_width
*
display_aspect_ratio
.
den
/
display_aspect_ratio
.
num
;
}
if
(
this
->
fps
<
(
double
)
this
->
framerate_new
.
num
/
this
->
framerate_new
.
den
)
{
this
->
framerate_new
.
num
=
vstream_fps
.
num
;
this
->
framerate_new
.
den
=
vstream_fps
.
den
;
...
...
@@ -1363,8 +1369,8 @@ void ff2theora_output(ff2theora this) {
if
(
av_picture_pad
((
AVPicture
*
)
output_padded
,
(
AVPicture
*
)
output_resized
,
this
->
frame_height
,
this
->
frame_width
,
this
->
pix_fmt
,
0
,
this
->
frame_
height
-
this
->
picture_heigh
t
,
0
,
this
->
frame_
width
-
this
->
picture_width
,
this
->
frame_
y_offset
,
this
->
frame_y_offse
t
,
this
->
frame_
x_offset
,
this
->
frame_x_offset
,
padcolor
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"error padding frame
\n
"
);
}
...
...
Write
Preview
Supports
Markdown
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