summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-02-18 08:15:52 -0800
committerMartin Storsjö <martin@martin.st>2013-03-06 21:18:50 +0200
commit8d061989dd0397da15aa29f52d243fe125bf2f5e (patch)
tree699546f4517dee6841f701ff8282c366e0efb22b /libavcodec/h264.c
parent5a4e9fe855282a99586050a507d0a486ad39df5b (diff)
lavc: Split out ff_hwaccel_pixfmt_list_420[] over individual codecs
Not all hwaccels implement all codecs, so using one single list for multiple such codecs means some codecs will be represented in the list, even though they don't actually handle that codec. Copying specific lists in each codec fixes that. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 0b22613bdf..aa2b1a7910 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -61,6 +61,23 @@ static const uint8_t div6[QP_MAX_NUM + 1] = {
7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
};
+static const enum AVPixelFormat h264_hwaccel_pixfmt_list_420[] = {
+#if CONFIG_H264_DXVA2_HWACCEL
+ AV_PIX_FMT_DXVA2_VLD,
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
+ AV_PIX_FMT_VAAPI_VLD,
+#endif
+#if CONFIG_H264_VDA_HWACCEL
+ AV_PIX_FMT_VDA_VLD,
+#endif
+#if CONFIG_H264_VDPAU_HWACCEL
+ AV_PIX_FMT_VDPAU,
+#endif
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+};
+
static const enum AVPixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = {
#if CONFIG_H264_DXVA2_HWACCEL
AV_PIX_FMT_DXVA2_VLD,
@@ -2823,7 +2840,7 @@ static enum PixelFormat get_pixel_format(H264Context *h)
h->avctx->codec->pix_fmts :
h->avctx->color_range == AVCOL_RANGE_JPEG ?
hwaccel_pixfmt_list_h264_jpeg_420 :
- ff_hwaccel_pixfmt_list_420);
+ h264_hwaccel_pixfmt_list_420);
}
break;
default: