Add support for H264 decoding

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
Maxime Ripard
2018-07-11 17:06:40 +02:00
committed by Paul Kocialkowski
parent d7d8fc744b
commit 1efa9d877e
7 changed files with 400 additions and 2 deletions
+48
View File
@@ -31,6 +31,7 @@
#include "config.h"
#include "mpeg2.h"
#include "h264.h"
#include <assert.h>
#include <string.h>
@@ -67,6 +68,43 @@ static VAStatus codec_store_buffer(struct sunxi_cedrus_driver_data *driver_data,
case VAProfileMPEG2Main:
memcpy(&surface_object->params.mpeg2.picture, buffer_object->data, sizeof(surface_object->params.mpeg2.picture));
break;
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
memcpy(&surface_object->params.h264.picture, buffer_object->data, sizeof(surface_object->params.h264.picture));
break;
default:
break;
}
break;
case VASliceParameterBufferType:
switch (profile) {
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
memcpy(&surface_object->params.h264.slice, buffer_object->data, sizeof(surface_object->params.h264.slice));
break;
default:
break;
}
break;
case VAIQMatrixBufferType:
switch (profile) {
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
memcpy(&surface_object->params.h264.matrix, buffer_object->data, sizeof(surface_object->params.h264.matrix));
break;
default:
break;
}
@@ -92,6 +130,16 @@ static VAStatus codec_set_controls(struct sunxi_cedrus_driver_data *driver_data,
return VA_STATUS_ERROR_OPERATION_FAILED;
break;
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
rc = h264_set_controls(driver_data, surface_object);
if (rc < 0)
return VA_STATUS_ERROR_OPERATION_FAILED;
break;
default:
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
}