[FFmpeg-devel] lavc/mediacodec: add hevc decoder

Matthieu Bouron matthieu.bouron at gmail.com
Wed Sep 7 17:53:52 EEST 2016


Hello,

The following patchset add support for hevc mediacodec decoding. The patchset
applies on top of:
    * lavc/mediacodecdec_h264: move bsf variable declaration at the top of the function
    * lavc/mediacodecdec_h264: use h264_parse.h instead of h264dec.h
which are going to be pushed in one hour or so (if there is no objection).

A development branch can be found at:
https://github.com/mbouron/FFmpeg/tree/feature/mediacodec-hevc-v2

[PATCH 1/2] lavc/hevc: store VPS/SPS/PPS data

This commit stores the original sodb vps/sps/pps data to their respective
structures defined in hevc.h. The data will be used later on by the MediaCodec
decoder which requires the extradata to be vps+sps+pps.
Note: the H264 decoder stores the original sodb sps/pps the same way in the PPS/SPS
structures.

[PATCH 2/2] lavc: add hevc mediacodec decoder

This commit adds the hevc mediacodec decoder as well as an hevc extradata
parsing function (ff_hevc_decode_extradata) which matches the api of
ff_h264_decode_extradata.

The code of ff_hevc_decode_extradata is taken from hevc.c (and adapted to not
rely on the HEVCContext structure).
The code of hevc_decode_nal_units is taken from the simple version of
parse_nal_units from hevc_parser.c. The function has been adapted to not rely
on the AVCodecParserContext and to not call hevc_parse_slice_header which is
not relevant when parsing extradata.

Obviously there is work to do here (like for h264) to unify all the hevc
extradata parsing functions as there are:
    * hevc_decode_extradata (hevc.c)
    * two variants of parse_nal_units (hevc_parser.c), one variant is chosen
    over the other depending on the presence of the hevc decoder
    * and now ff_hevc_decode_extradata (hevc_parse.c)

The patch lacks a minor bump in libavcodec/version.h and a changelog entry
(which are going to be added in another revision of the patch).

Matthieu


More information about the ffmpeg-devel mailing list