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
fd73d546
Commit
fd73d546
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
resizer: do not go past the hardware limitations (0.25 to 4)
Signed-off-by:
Jean-Paul Saman
<
jean-paul.saman@m2x.nl
>
parent
fe8d7919
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
modules/codec/davinci/viddec.c
modules/codec/davinci/viddec.c
+26
-7
No files found.
modules/codec/davinci/viddec.c
View file @
fd73d546
...
...
@@ -85,16 +85,36 @@ 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
)
static
void
Resize
(
decoder_t
*
p_dec
,
unsigned
int
*
i_width
,
unsigned
int
*
i_height
)
{
unsigned
int
i_vidw
=
p_dec
->
fmt_out
.
video
.
i_width
;
unsigned
int
i_vidh
=
p_dec
->
fmt_out
.
video
.
i_height
;
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 */
msg_Dbg
(
p_dec
,
"Original Video %dx%d, Output destination %dx%d"
,
i_vidw
,
i_vidh
,
*
i_width
,
*
i_height
);
/* else choose the minimum for both axes */
/* Davinci Resizer can only do from x0.25 to x4 */
if
(
i_hratio
/
4
<
VOUT_ASPECT_FACTOR
)
i_hratio
=
VOUT_ASPECT_FACTOR
/
4
;
else
if
(
i_hratio
*
4
>
VOUT_ASPECT_FACTOR
)
i_hratio
=
VOUT_ASPECT_FACTOR
*
4
;
/* do that also for the width */
if
(
i_wratio
/
4
<
VOUT_ASPECT_FACTOR
)
i_wratio
=
VOUT_ASPECT_FACTOR
/
4
;
else
if
(
i_wratio
*
4
>
VOUT_ASPECT_FACTOR
)
i_wratio
=
VOUT_ASPECT_FACTOR
*
4
;
msg_Dbg
(
p_dec
,
"Final resolution %dx%d (%.2f , %.2f)"
,
i_vidw
*
i_wratio
/
VOUT_ASPECT_FACTOR
,
i_vidh
*
i_hratio
/
VOUT_ASPECT_FACTOR
,
(
float
)
i_wratio
/
VOUT_ASPECT_FACTOR
,
(
float
)
i_hratio
/
VOUT_ASPECT_FACTOR
);
/* choose the minimum for both axes */
i_hratio
=
i_wratio
=
i_hratio
<
i_wratio
?
i_hratio
:
i_wratio
;
/* and set the new resolution accordingly */
...
...
@@ -737,8 +757,7 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
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
);
Resize
(
p_dec
,
&
rsz_params
.
out_hsize
,
&
rsz_params
.
out_vsize
);
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