Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
cc6a1f14
Commit
cc6a1f14
authored
Jul 24, 2019
by
Paul B Mahol
Committed by
Kieran Kunhya
Jul 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/adxenc: add EOF header
Fixes #8031.
parent
923d5c48
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
adxenc.c
libavcodec/adxenc.c
+20
-1
adpcm-adx
tests/ref/acodec/adpcm-adx
+2
-2
adpcm-adx-trellis
tests/ref/acodec/adpcm-adx-trellis
+2
-2
No files found.
libavcodec/adxenc.c
View file @
cc6a1f14
...
...
@@ -141,10 +141,26 @@ static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const
AVFrame
*
frame
,
int
*
got_packet_ptr
)
{
ADXContext
*
c
=
avctx
->
priv_data
;
const
int16_t
*
samples
=
(
const
int16_t
*
)
frame
->
data
[
0
]
;
const
int16_t
*
samples
=
frame
?
(
const
int16_t
*
)
frame
->
data
[
0
]
:
NULL
;
uint8_t
*
dst
;
int
ch
,
out_size
,
ret
;
if
(
!
samples
)
{
if
(
c
->
eof
)
return
0
;
if
((
ret
=
ff_alloc_packet2
(
avctx
,
avpkt
,
18
,
0
))
<
0
)
return
ret
;
c
->
eof
=
1
;
dst
=
avpkt
->
data
;
bytestream_put_be16
(
&
dst
,
0x8001
);
bytestream_put_be16
(
&
dst
,
0x000E
);
bytestream_put_be64
(
&
dst
,
0x0
);
bytestream_put_be32
(
&
dst
,
0x0
);
bytestream_put_be16
(
&
dst
,
0x0
);
*
got_packet_ptr
=
1
;
return
0
;
}
out_size
=
BLOCK_SIZE
*
avctx
->
channels
+
!
c
->
header_parsed
*
HEADER_SIZE
;
if
((
ret
=
ff_alloc_packet2
(
avctx
,
avpkt
,
out_size
,
0
))
<
0
)
return
ret
;
...
...
@@ -165,6 +181,8 @@ static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
dst
+=
BLOCK_SIZE
;
}
avpkt
->
pts
=
frame
->
pts
;
avpkt
->
duration
=
frame
->
nb_samples
;
*
got_packet_ptr
=
1
;
return
0
;
}
...
...
@@ -177,6 +195,7 @@ AVCodec ff_adpcm_adx_encoder = {
.
priv_data_size
=
sizeof
(
ADXContext
),
.
init
=
adx_encode_init
,
.
encode2
=
adx_encode_frame
,
.
capabilities
=
AV_CODEC_CAP_DELAY
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
},
};
tests/ref/acodec/adpcm-adx
View file @
cc6a1f14
6bf1a8e5ec9cc958a31cb2b1b66bfc75
*tests/data/fate/acodec-adpcm-adx.adx
2977
20
tests/data/fate/acodec-adpcm-adx.adx
c257001314241b469a6512616fd56548
*tests/data/fate/acodec-adpcm-adx.adx
2977
38
tests/data/fate/acodec-adpcm-adx.adx
5b5a436ec9d528d6eb0bebaf667521b0 *tests/data/fate/acodec-adpcm-adx.out.wav
stddev: 2549.93 PSNR: 28.20 MAXDIFF:57514 bytes: 1058400/ 1058432
tests/ref/acodec/adpcm-adx-trellis
View file @
cc6a1f14
6bf1a8e5ec9cc958a31cb2b1b66bfc75
*tests/data/fate/acodec-adpcm-adx-trellis.adx
2977
20
tests/data/fate/acodec-adpcm-adx-trellis.adx
c257001314241b469a6512616fd56548
*tests/data/fate/acodec-adpcm-adx-trellis.adx
2977
38
tests/data/fate/acodec-adpcm-adx-trellis.adx
5b5a436ec9d528d6eb0bebaf667521b0 *tests/data/fate/acodec-adpcm-adx-trellis.out.wav
stddev: 2549.93 PSNR: 28.20 MAXDIFF:57514 bytes: 1058400/ 1058432
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