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
fe8d7919
Commit
fe8d7919
authored
Aug 29, 2008
by
Rafaël Carré
Committed by
Jean-Paul Saman
Nov 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
viddec: keeps the same aspect ratio for width and height when resizing
Signed-off-by:
Jean-Paul Saman
<
jean-paul.saman@m2x.nl
>
parent
cc8b74fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
modules/codec/davinci/viddec.c
modules/codec/davinci/viddec.c
+22
-0
No files found.
modules/codec/davinci/viddec.c
View file @
fe8d7919
...
...
@@ -85,6 +85,24 @@ struct decoder_sys_t
#ifdef DAVINCI_HACK
static
void
Resize
(
unsigned
int
*
i_width
,
unsigned
int
*
i_height
,
unsigned
int
i_vidw
,
unsigned
int
i_vidh
)
{
unsigned
int
i_hratio
=
VOUT_ASPECT_FACTOR
*
*
i_height
/
i_vidh
;
unsigned
int
i_wratio
=
VOUT_ASPECT_FACTOR
*
*
i_width
/
i_vidw
;
if
(
i_hratio
==
i_wratio
)
return
;
/* nothing to do */
/* else choose the minimum for both axes */
i_hratio
=
i_wratio
=
i_hratio
<
i_wratio
?
i_hratio
:
i_wratio
;
/* and set the new resolution accordingly */
*
i_height
=
(
i_vidh
*
i_hratio
)
/
VOUT_ASPECT_FACTOR
;
*
i_width
=
(
i_vidw
*
i_wratio
)
/
VOUT_ASPECT_FACTOR
;
}
/* open() a framebuffer by its name (NOT device path) */
static
int
OpenFB
(
const
char
*
psz_name
)
{
int
i_fd
=
-
1
;
...
...
@@ -715,8 +733,12 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
(
p_dec
->
fmt_out
.
video
.
i_width
*
BPP
/
8
+
31
)
&
~
31
;
rsz_params
.
inptyp
=
RSZ_INTYPE_YCBCR422_16BIT
;
rsz_params
.
pix_fmt
=
RSZ_PIX_FMT_YUYV
;
/* Sets the destination resolution */
rsz_params
.
out_hsize
=
p_sys
->
var_info
.
xres
;
rsz_params
.
out_vsize
=
p_sys
->
var_info
.
yres
;
/* And then modify it to keep the same aspect ratio */
Resize
(
&
rsz_params
.
out_hsize
,
&
rsz_params
.
out_vsize
,
p_dec
->
fmt_out
.
video
.
i_width
,
p_dec
->
fmt_out
.
video
.
i_height
);
rsz_params
.
out_pitch
=
p_sys
->
fix_info
.
line_length
;
short
hcoefs
[
32
]
=
{
...
...
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