Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
a3de4010
Commit
a3de4010
authored
Dec 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8svx: decode directly to the user-provided AVFrame
parent
fd1abf42
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
8svx.c
libavcodec/8svx.c
+5
-9
No files found.
libavcodec/8svx.c
View file @
a3de4010
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
/** decoder context */
/** decoder context */
typedef
struct
EightSvxContext
{
typedef
struct
EightSvxContext
{
AVFrame
frame
;
uint8_t
fib_acc
[
2
];
uint8_t
fib_acc
[
2
];
const
int8_t
*
table
;
const
int8_t
*
table
;
...
@@ -85,6 +84,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -85,6 +84,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
int
*
got_frame_ptr
,
AVPacket
*
avpkt
)
int
*
got_frame_ptr
,
AVPacket
*
avpkt
)
{
{
EightSvxContext
*
esc
=
avctx
->
priv_data
;
EightSvxContext
*
esc
=
avctx
->
priv_data
;
AVFrame
*
frame
=
data
;
int
buf_size
;
int
buf_size
;
int
ch
,
ret
;
int
ch
,
ret
;
int
is_compr
=
(
avctx
->
codec_id
!=
AV_CODEC_ID_PCM_S8_PLANAR
);
int
is_compr
=
(
avctx
->
codec_id
!=
AV_CODEC_ID_PCM_S8_PLANAR
);
...
@@ -136,18 +136,18 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -136,18 +136,18 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
}
}
/* get output buffer */
/* get output buffer */
esc
->
frame
.
nb_samples
=
buf_size
*
(
is_compr
+
1
);
frame
->
nb_samples
=
buf_size
*
(
is_compr
+
1
);
if
((
ret
=
ff_get_buffer
(
avctx
,
&
esc
->
frame
))
<
0
)
{
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
return
ret
;
}
}
for
(
ch
=
0
;
ch
<
avctx
->
channels
;
ch
++
)
{
for
(
ch
=
0
;
ch
<
avctx
->
channels
;
ch
++
)
{
if
(
is_compr
)
{
if
(
is_compr
)
{
delta_decode
(
esc
->
frame
.
data
[
ch
],
&
esc
->
data
[
ch
][
esc
->
data_idx
],
delta_decode
(
frame
->
data
[
ch
],
&
esc
->
data
[
ch
][
esc
->
data_idx
],
buf_size
,
&
esc
->
fib_acc
[
ch
],
esc
->
table
);
buf_size
,
&
esc
->
fib_acc
[
ch
],
esc
->
table
);
}
else
{
}
else
{
raw_decode
(
esc
->
frame
.
data
[
ch
],
&
esc
->
data
[
ch
][
esc
->
data_idx
],
raw_decode
(
frame
->
data
[
ch
],
&
esc
->
data
[
ch
][
esc
->
data_idx
],
buf_size
);
buf_size
);
}
}
}
}
...
@@ -155,7 +155,6 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -155,7 +155,6 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
esc
->
data_idx
+=
buf_size
;
esc
->
data_idx
+=
buf_size
;
*
got_frame_ptr
=
1
;
*
got_frame_ptr
=
1
;
*
(
AVFrame
*
)
data
=
esc
->
frame
;
return
avpkt
->
size
;
return
avpkt
->
size
;
}
}
...
@@ -184,9 +183,6 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
...
@@ -184,9 +183,6 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
}
}
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_U8P
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_U8P
;
avcodec_get_frame_defaults
(
&
esc
->
frame
);
avctx
->
coded_frame
=
&
esc
->
frame
;
return
0
;
return
0
;
}
}
...
...
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