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
93509622
Commit
93509622
authored
Dec 11, 2009
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
davinci encoder: cleanup
parent
9994ce52
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
45 deletions
+43
-45
modules/codec/davinci/audio.c
modules/codec/davinci/audio.c
+7
-7
modules/codec/davinci/davinci.c
modules/codec/davinci/davinci.c
+5
-5
modules/codec/davinci/davinci.h
modules/codec/davinci/davinci.h
+5
-7
modules/codec/davinci/encoder.c
modules/codec/davinci/encoder.c
+7
-7
modules/codec/davinci/fb.c
modules/codec/davinci/fb.c
+8
-8
modules/codec/davinci/resizer.c
modules/codec/davinci/resizer.c
+3
-3
modules/codec/davinci/video.c
modules/codec/davinci/video.c
+8
-8
No files found.
modules/codec/davinci/audio.c
View file @
93509622
...
...
@@ -122,7 +122,7 @@ int OpenAudioDecoder( vlc_object_t *p_this )
goto
error
;
}
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
davinci_
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
/* Create audio decoder */
params
.
size
=
sizeof
(
params
);
...
...
@@ -181,8 +181,8 @@ void CloseAudioDecoder( vlc_object_t *p_this )
CERuntime_exit
();
/* Free 'DaVinci compliant' buffers */
FreeBuffer
(
&
p_sys
->
in
);
FreeBuffer
(
&
p_sys
->
out
);
davinci_
FreeBuffer
(
&
p_sys
->
in
);
davinci_
FreeBuffer
(
&
p_sys
->
out
);
free
(
p_sys
->
psz_ti_engine
);
free
(
p_sys
);
...
...
@@ -215,16 +215,16 @@ static int InitXDMAudioDecoder( decoder_t *p_dec, AUDDEC_DynamicParams *dparams
}
/* Allocate input buffer */
if
(
AllocateBuffer
(
p_dec
,
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
!=
VLC_SUCCESS
)
if
(
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_dec
,
"Failed to allocate input buffer"
);
return
VLC_EGENERIC
;
}
/* Allocate output buffer */
if
(
AllocateBuffer
(
p_dec
,
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
!=
VLC_SUCCESS
)
if
(
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_dec
,
"Failed to allocate output buffer"
);
return
VLC_EGENERIC
;
...
...
modules/codec/davinci/davinci.c
View file @
93509622
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Antoine Cellerier <dionoea at videolan dot org>
* Jean-Paul Saman <jean-paul.saman at m2x dot nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -143,8 +144,8 @@ vlc_module_end()
*****************************************************************************/
#include <ti/sdo/ce/osal/Memory.h>
int
__AllocateBuffer
(
vlc_object_t
*
p_this
,
XDAS_Int32
i_num
,
XDAS_Int32
*
pi_sizes
,
XDM_BufDesc
*
buf
)
int
davinci_AllocateBuffer
(
XDAS_Int32
i_num
,
XDAS_Int32
*
pi_sizes
,
XDM_BufDesc
*
buf
)
{
int
i
;
...
...
@@ -171,7 +172,6 @@ int __AllocateBuffer( vlc_object_t *p_this, XDAS_Int32 i_num,
buf
->
bufs
[
i
]
=
Memory_contigAlloc
(
pi_sizes
[
i
],
Memory_DEFAULTALIGNMENT
);
if
(
!
buf
->
bufs
[
i
]
)
{
msg_Err
(
p_this
,
"Failed to allocate buffer"
);
for
(
i
--
;
i
>=
0
;
i
--
)
Memory_contigFree
(
buf
->
bufs
[
i
],
buf
->
bufSizes
[
i
]
);
...
...
@@ -184,7 +184,7 @@ int __AllocateBuffer( vlc_object_t *p_this, XDAS_Int32 i_num,
return
VLC_SUCCESS
;
}
void
FreeBuffer
(
XDM_BufDesc
*
buf
)
void
davinci_
FreeBuffer
(
XDM_BufDesc
*
buf
)
{
if
(
buf
->
numBufs
!=
0
)
{
...
...
@@ -239,7 +239,7 @@ const char * davinci_GetExtendedError( XDAS_Int32 error )
return
"Unkown error"
;
}
void
_
_PrintAvailableAlgorithms
(
vlc_object_t
*
p_this
,
const
char
*
psz_engine
)
void
davinci
_PrintAvailableAlgorithms
(
vlc_object_t
*
p_this
,
const
char
*
psz_engine
)
{
int
i
=
0
;
Engine_AlgInfo
info
;
...
...
modules/codec/davinci/davinci.h
View file @
93509622
...
...
@@ -47,18 +47,16 @@ void CloseAudioDecoder( vlc_object_t * );
int
OpenVideoEncoder
(
vlc_object_t
*
);
void
CloseVideoEncoder
(
vlc_object_t
*
);
int
__AllocateBuffer
(
vlc_object_t
*
,
XDAS_Int32
,
XDAS_Int32
*
,
XDM_BufDesc
*
);
#define AllocateBuffer( a, b, c, d ) __AllocateBuffer( VLC_OBJECT( a ), b, c, d )
void
FreeBuffer
(
XDM_BufDesc
*
);
const
char
*
davinci_GetExtendedError
(
XDAS_Int32
);
void
__PrintAvailableAlgorithms
(
vlc_object_t
*
,
const
char
*
);
#define PrintAvailableAlgorithms( a, b ) __PrintAvailableAlgorithms( VLC_OBJECT( a ), b )
/*****************************************************************************
* Common stuff
*****************************************************************************/
extern
const
char
*
ppsz_engine_error
[];
int
davinci_AllocateBuffer
(
XDAS_Int32
,
XDAS_Int32
*
,
XDM_BufDesc
*
);
void
davinci_FreeBuffer
(
XDM_BufDesc
*
);
const
char
*
davinci_GetExtendedError
(
XDAS_Int32
);
void
davinci_PrintAvailableAlgorithms
(
vlc_object_t
*
,
const
char
*
);
bool
GetDavinciDecoder
(
vlc_fourcc_t
,
int
*
,
const
char
**
,
const
char
**
);
bool
GetDavinciEncoder
(
vlc_fourcc_t
,
int
*
,
const
char
**
,
const
char
**
);
bool
GetVlcFourcc
(
const
char
*
,
int
*
,
vlc_fourcc_t
*
,
const
char
**
);
...
...
modules/codec/davinci/encoder.c
View file @
93509622
...
...
@@ -116,7 +116,7 @@ int OpenVideoEncoder( vlc_object_t *p_this )
goto
error
;
}
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
davinci_
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
/* Configure encoder */
params
.
size
=
sizeof
(
params
);
...
...
@@ -213,8 +213,8 @@ void CloseVideoEncoder( vlc_object_t *p_this )
CERuntime_exit
();
/* XXX: Should this be done only once (if we have encoder + decoder runing) */
/* Free 'DaVinci compliant' buffers */
FreeBuffer
(
&
p_sys
->
in
);
FreeBuffer
(
&
p_sys
->
out
);
davinci_
FreeBuffer
(
&
p_sys
->
in
);
davinci_
FreeBuffer
(
&
p_sys
->
out
);
free
(
p_sys
->
psz_ti_engine
);
free
(
p_sys
);
...
...
@@ -291,8 +291,8 @@ static int davinci_InitBuffers( encoder_t *p_enc )
}
/* Allocate input buffer(s) */
if
(
i_ret
=
AllocateBuffer
(
p_enc
,
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
if
(
(
i_ret
=
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_enc
,
"Failed to allocate input buffers"
);
...
...
@@ -300,8 +300,8 @@ static int davinci_InitBuffers( encoder_t *p_enc )
}
/* Allocate output buffer */
if
(
i_ret
=
AllocateBuffer
(
p_enc
,
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
if
(
(
i_ret
=
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_enc
,
"Failed to allocate input buffers"
);
...
...
modules/codec/davinci/fb.c
View file @
93509622
...
...
@@ -160,7 +160,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
goto
error
;
}
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
davinci_
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
/* Get user supplied chroma setting */
psz_chroma
=
config_GetPsz
(
p_dec
,
DEC_CFG_PREFIX
"chroma"
);
...
...
@@ -270,8 +270,8 @@ void CloseVideoDecoder( vlc_object_t *p_this )
#endif
/* Free 'DaVinci compliant' buffers */
FreeBuffer
(
&
p_sys
->
in
);
FreeBuffer
(
&
p_sys
->
out
);
davinci_
FreeBuffer
(
&
p_sys
->
in
);
davinci_
FreeBuffer
(
&
p_sys
->
out
);
free
(
p_sys
->
psz_ti_engine
);
free
(
p_sys
);
...
...
@@ -353,8 +353,8 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
/* Allocate input buffer */
if
(
AllocateBuffer
(
p_dec
,
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
if
(
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_dec
,
"Failed to allocate input buffers"
);
...
...
@@ -362,11 +362,11 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
/* Allocate output buffer(s) */
if
(
AllocateBuffer
(
p_dec
,
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
if
(
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
!=
VLC_SUCCESS
)
{
FreeBuffer
(
&
p_sys
->
in
);
davinci_
FreeBuffer
(
&
p_sys
->
in
);
msg_Err
(
p_dec
,
"Failed to allocate output buffers"
);
goto
error
;
}
...
...
modules/codec/davinci/resizer.c
View file @
93509622
...
...
@@ -68,9 +68,9 @@ static void Resize_coeff( decoder_t *p_dec,
*
i_height
=
((
i_vidh
-
i_vtap
)
*
256
-
(
i_vtap
==
7
?
32
:
16
))
/
i_vrsz
+
1
;
/* width must be a factor of 16 : davinci resizer limitation when doing
*
* vertical upscaling, 16 bytes per output line
*
* the bpp is 2 so a factor of 8 should be good but not in practice
*
*/
* vertical upscaling, 16 bytes per output line
* the bpp is 2 so a factor of 8 should be good but not in practice
*/
*
i_width
=
(
*
i_width
+
15
)
&
~
15
;
msg_Dbg
(
p_dec
,
"Destination fixed to %dx%d"
,
*
i_width
,
*
i_height
);
...
...
modules/codec/davinci/video.c
View file @
93509622
...
...
@@ -107,7 +107,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
goto
error
;
}
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
davinci_
PrintAvailableAlgorithms
(
p_this
,
p_sys
->
psz_ti_engine
);
/* Get user supplied chroma setting */
psz_chroma
=
var_CreateGetString
(
p_dec
,
DEC_CFG_PREFIX
"fourcc"
);
...
...
@@ -200,8 +200,8 @@ void CloseVideoDecoder( vlc_object_t *p_this )
CERuntime_exit
();
/* Free 'DaVinci compliant' buffers */
FreeBuffer
(
&
p_sys
->
in
);
FreeBuffer
(
&
p_sys
->
out
);
davinci_
FreeBuffer
(
&
p_sys
->
in
);
davinci_
FreeBuffer
(
&
p_sys
->
out
);
free
(
p_sys
->
psz_ti_engine
);
free
(
p_sys
);
...
...
@@ -296,8 +296,8 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
/* Allocate input buffer */
if
(
AllocateBuffer
(
p_dec
,
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
if
(
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumInBufs
,
status
.
bufInfo
.
minInBufSize
,
&
p_sys
->
in
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_dec
,
"Failed to allocate input buffers"
);
...
...
@@ -305,11 +305,11 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
/* Allocate output buffer(s) */
if
(
AllocateBuffer
(
p_dec
,
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
if
(
davinci_AllocateBuffer
(
status
.
bufInfo
.
minNumOutBufs
,
status
.
bufInfo
.
minOutBufSize
,
&
p_sys
->
out
)
!=
VLC_SUCCESS
)
{
FreeBuffer
(
&
p_sys
->
in
);
davinci_
FreeBuffer
(
&
p_sys
->
in
);
msg_Err
(
p_dec
,
"Failed to allocate output buffers"
);
goto
error
;
}
...
...
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