Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
1ba32fb7
Commit
1ba32fb7
authored
Aug 13, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transcode: avoid conversion to double
parent
953f3b12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
modules/stream_out/Modules.am
modules/stream_out/Modules.am
+1
-0
modules/stream_out/transcode/video.c
modules/stream_out/transcode/video.c
+8
-7
No files found.
modules/stream_out/Modules.am
View file @
1ba32fb7
...
...
@@ -20,6 +20,7 @@ libstream_out_transcode_plugin_la_SOURCES = \
transcode/transcode.c transcode/transcode.h \
transcode/osd.c transcode/spu.c transcode/audio.c transcode/video.c
libstream_out_transcode_plugin_la_CFLAGS = $(AM_CFLAGS)
libstream_out_transcode_plugin_la_LIBADD = $(LIBM)
stream_out_LTLIBRARIES += \
...
...
modules/stream_out/transcode/video.c
View file @
1ba32fb7
...
...
@@ -30,6 +30,7 @@
#include "transcode.h"
#include <math.h>
#include <vlc_meta.h>
#include <vlc_spu.h>
#include <vlc_modules.h>
...
...
@@ -398,11 +399,11 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
p_fmt_out
->
video
.
i_sar_den
/
p_fmt_out
->
video
.
i_height
;
msg_Dbg
(
p_stream
,
"decoder aspect is %f:1"
,
f_aspect
);
msg_Dbg
(
p_stream
,
"decoder aspect is %f:1"
,
(
double
)
f_aspect
);
/* Change f_aspect from source frame to source pixel */
f_aspect
=
f_aspect
*
i_src_visible_height
/
i_src_visible_width
;
msg_Dbg
(
p_stream
,
"source pixel aspect is %f:1"
,
f_aspect
);
msg_Dbg
(
p_stream
,
"source pixel aspect is %f:1"
,
(
double
)
f_aspect
);
/* Calculate scaling factor for specified parameters */
if
(
id
->
p_encoder
->
fmt_out
.
video
.
i_visible_width
<=
0
&&
...
...
@@ -463,17 +464,17 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
/* Change aspect ratio from source pixel to scaled pixel */
f_aspect
=
f_aspect
*
f_scale_height
/
f_scale_width
;
msg_Dbg
(
p_stream
,
"scaled pixel aspect is %f:1"
,
f_aspect
);
msg_Dbg
(
p_stream
,
"scaled pixel aspect is %f:1"
,
(
double
)
f_aspect
);
/* f_scale_width and f_scale_height are now final */
/* Calculate width, height from scaling
* Make sure its multiple of 2
*/
/* width/height of output stream */
int
i_dst_visible_width
=
2
*
(
int
)(
f_scale_width
*
i_src_visible_width
/
2
+
0
.
5
);
int
i_dst_visible_height
=
2
*
(
int
)(
f_scale_height
*
i_src_visible_height
/
2
+
0
.
5
);
int
i_dst_width
=
2
*
(
int
)(
f_scale_width
*
p_fmt_out
->
video
.
i_width
/
2
+
0
.
5
);
int
i_dst_height
=
2
*
(
int
)(
f_scale_height
*
p_fmt_out
->
video
.
i_height
/
2
+
0
.
5
);
int
i_dst_visible_width
=
2
*
lroundf
(
f_scale_width
*
i_src_visible_width
/
2
);
int
i_dst_visible_height
=
2
*
lroundf
(
f_scale_height
*
i_src_visible_height
/
2
);
int
i_dst_width
=
2
*
lroundf
(
f_scale_width
*
p_fmt_out
->
video
.
i_width
/
2
);
int
i_dst_height
=
2
*
lroundf
(
f_scale_height
*
p_fmt_out
->
video
.
i_height
/
2
);
/* Change aspect ratio from scaled pixel to output frame */
f_aspect
=
f_aspect
*
i_dst_visible_width
/
i_dst_visible_height
;
...
...
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