mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
avcodec/rangecoder: Move ff_rac_check_termination to tests/rangecoder.c
It is only used there. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
f729dee615
commit
bce9c5e276
3 changed files with 27 additions and 29 deletions
|
|
@ -121,22 +121,3 @@ int ff_rac_terminate(RangeCoder *c, int version)
|
|||
|
||||
return c->bytestream - c->bytestream_start;
|
||||
}
|
||||
|
||||
int ff_rac_check_termination(RangeCoder *c, int version)
|
||||
{
|
||||
if (version == 1) {
|
||||
RangeCoder tmp = *c;
|
||||
get_rac(c, (uint8_t[]) { 129 });
|
||||
|
||||
if (c->bytestream == tmp.bytestream && c->bytestream > c->bytestream_start)
|
||||
tmp.low -= *--tmp.bytestream;
|
||||
tmp.bytestream_end = tmp.bytestream;
|
||||
|
||||
if (get_rac(&tmp, (uint8_t[]) { 129 }))
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else {
|
||||
if (c->bytestream_end != c->bytestream)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue