summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-08-08 20:27:24 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-09-22 16:20:54 +0200
commit547c2f002a87f4412a83c23b0d60364be5e7ce58 (patch)
treeb7ae4ce31ea8d8344a54c1290a4f690936d46a80 /libavcodec/avcodec.h
parenta5cbf1991c3d04b0be3c23ee0a7096b5a365cc85 (diff)
Make decoding alpha optional for some codecs.
For codecs where decoding of a whole plane can simply be skipped, we should offer applications to not decode alpha for better performance (ca. 30% less CPU usage and 40% reduced memory bandwidth). It also means applications do not need to implement support (even if it is rather simple) for YUVA formats in order to be able to play these files. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 997a00cbf6..61048f4dcf 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2865,6 +2865,19 @@ typedef struct AVCodecContext {
#define FF_SUB_CHARENC_MODE_AUTOMATIC 0 ///< libavcodec will select the mode itself
#define FF_SUB_CHARENC_MODE_PRE_DECODER 1 ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv
+ /**
+ * Skip processing alpha if supported by codec.
+ * Note that if the format uses pre-multiplied alpha (common with VP6,
+ * and recommended due to better video quality/compression)
+ * the image will look as if alpha-blended onto a black background.
+ * However for formats that do not use pre-multiplied alpha
+ * there might be serious artefacts (though e.g. libswscale currently
+ * assumes pre-multiplied alpha anyway).
+ *
+ * - decoding: set by user
+ * - encoding: unused
+ */
+ int skip_alpha;
} AVCodecContext;
AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);