Commit Graph

14 Commits

Author SHA1 Message Date
Andreas Rheinhardt 1be3d8a0cb avcodec/avcodec: Stop including channel_layout.h in avcodec.h
Also include channel_layout.h directly wherever used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 11:14:31 +02:00
Andreas Rheinhardt a247ac640d avcodec: Constify AVCodecs
Given that the AVCodec.next pointer has now been removed, most of the
AVCodecs are not modified at all any more and can therefore be made
const (as this patch does); the only exceptions are the very few codecs
for external libraries that have a init_static_data callback.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:15 -03:00
Andreas Rheinhardt 44e27d937d avcodec/dolby_e: Avoid duplicating sample rate table
Set the sample rate when parsing the header instead and only copy the
value in the decoder and the parser.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-30 05:14:45 +01:00
Andreas Rheinhardt 7c27513d04 avcodec/dolby_e: Avoid code duplication when converting input
convert_input, a nontrivial auxiliary function used by both the general
parsing code as well as the decoder itself, has been duplicated in
c7016e35a624a75bb5b82bee932ddfe28d013b3f; this commit removes said
duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-30 05:14:45 +01:00
Andreas Rheinhardt 8cbff41583 avcodec/dolby_e_parse: Merge ff_dolby_e_parse_init/header
These two functions are always called after another; after all, what
ff_dolby_e_parse_init does is obviously part of parsing the frame header.

Also move the DolbyEHeaderInfo into DBEContext so that parsing the frame
header only needs one struct (both users used a DBEContext immediately
followed by a separate DolbyEHeaderInfo).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-30 05:14:45 +01:00
James Almer 81d070dd09 avcodec/dolby_e: split decoder and parser more thoroughly
Neither module should depend on the other.

Move shared functions to its own file for this purpose, and ensure
source files are compiled only when the required modules are enabled.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-01-25 16:45:20 -03:00
Nicolas Gaullier c7016e35a6 avcodec/dolby_e: Split decoder/parser files 2021-01-25 13:19:48 +01:00
Nicolas Gaullier 0bf18db26a avcodec/dolby_e: Add a parser 2021-01-25 13:17:43 +01:00
Anton Khirnov c8c2dfbc37 lavu: move LOCAL_ALIGNED from internal.h to mem_internal.h
That is a more appropriate place for it.
2021-01-01 14:11:01 +01:00
Jun Zhao 4030d3d3f4 lavc/dolby_e: fix make checkheaders warning
move the the function init_tables() definitions from header file
to .c file to fix make checkheaders warning.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-06-10 08:46:09 +08:00
foo86 5e715b583d avcodec/dolby_e: fix potentially undefined pointer arithmetic
Avoid undefined behavior in skip_input() by checking that enough data is
available before incrementing input pointer.

Check return values of parse_key() and skip_input() and exit early with
error if there is not enough data.
2017-07-26 21:23:07 +03:00
foo86 0689cc2475 avcodec/dolby_e: add AV_CODEC_CAP_CHANNEL_CONF capability 2017-07-26 21:23:07 +03:00
James Almer cb13f44831 avcodec/dolby_e: use av_clip_uintp2()
Fixes fate-source.
2017-07-19 15:19:59 -03:00
foo86 930fe4b1f7 avcodec: add Dolby E decoder 2017-07-19 12:27:32 +02:00