summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-01-05 20:24:18 +0100
committerJohns <johns98@gmx.net>2012-01-05 20:24:18 +0100
commit761c06eac13c3b3504cee30e36af28347c8f1740 (patch)
tree943af1c576a06e521c9e54fc717ff409a189c038
parent0776bc5ee472f5013e2507ecb088673e9152caee (diff)
downloadvdr-plugin-softhddevice-761c06eac13c3b3504cee30e36af28347c8f1740.tar.gz
vdr-plugin-softhddevice-761c06eac13c3b3504cee30e36af28347c8f1740.tar.bz2
Add color standard support to vdpau.
-rw-r--r--ChangeLog1
-rw-r--r--Todo4
-rw-r--r--video.c48
3 files changed, 42 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 523d0e7..500178a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
User johns
Data:
+ VDPAU: Add color standard support.
VDPAU: Add denoise and sharpness support.
VDPAU: Add skip chroma deinterlace support.
VDPAU: Show OSD only if something is to display, improves performance.
diff --git a/Todo b/Todo
index 548f00d..eb281b4 100644
--- a/Todo
+++ b/Todo
@@ -33,8 +33,8 @@ missing:
ITU BT601, ITU BT709 (HD), RGB studio levels (16-235)?
vdpau:
- 1080i with temporal spatial and level 1 scaling too slow with GT 520
- 1080i with temporal spatial too slow with GT 520 on some channels
+ 1080i with temporal spatial and level 1 scaling too slow with my GT 520
+ 1080i with temporal spatial too slow with my GT 520 on some channels
SkipChromaDeinterlace improves performance
Improve OSD handling, show only what is used. Big OSD costs performance
VdpPreemptionCallback handling
diff --git a/video.c b/video.c
index 15336b4..0c63dcf 100644
--- a/video.c
+++ b/video.c
@@ -179,7 +179,7 @@ typedef enum _video_zoom_modes_
#define CODEC_SURFACES_VC1 3 ///< 1 decode, up to 2 references
#define VIDEO_SURFACES_MAX 4 ///< video output surfaces for queue
-#define OUTPUT_SURFACES_MAX 2 ///< output surfaces for flip page
+#define OUTPUT_SURFACES_MAX 4 ///< output surfaces for flip page
//----------------------------------------------------------------------------
// Variables
@@ -3105,6 +3105,7 @@ typedef struct _vdpau_decoder_
VdpDecoder VideoDecoder; ///< vdp video decoder
VdpVideoMixer VideoMixer; ///< vdp video mixer
VdpChromaType ChromaType; ///< vdp video surface chroma format
+ VdpProcamp Procamp; ///< vdp procamp parameterization data
int SurfaceUsedN; ///< number of used video surfaces
/// used video surface ids
@@ -3406,14 +3407,16 @@ static void VdpauMixerSetup(VdpauDecoder * decoder)
VdpVideoMixerParameter paramaters[4];
void const *value_ptrs[4];
int parameter_n;
- VdpVideoMixerAttribute attributes[3];
- void const *attribute_value_ptrs[3];
+ VdpVideoMixerAttribute attributes[4];
+ void const *attribute_value_ptrs[4];
int attribute_n;
uint8_t skip_chroma_value;
float noise_reduction_level;
float sharpness_level;
VdpChromaType chroma_type;
int layers;
+ VdpColorStandard color_standard;
+ VdpCSCMatrix csc_matrix[1];
//
// Build feature table
@@ -3515,11 +3518,14 @@ static void VdpauMixerSetup(VdpauDecoder * decoder)
}
VdpauVideoMixerSetFeatureEnables(decoder->VideoMixer, feature_n, features,
enables);
+ // FIXME: check status
+
+ //
+ // build attributes table
+ //
/*
FIXME:
- VDP_VIDEO_MIXER_ATTRIBUTE_NOISE_REDUCTION_LEVEL
- VDP_VIDEO_MIXER_ATTRIBUTE_SHARPNESS_LEVEL
VDP_VIDEO_MIXER_ATTRIBUTE_LUMA_KEY_MIN_LUMA
VDP_VIDEO_MIXER_ATTRIBUTE_LUMA_KEY_MAX_LUMA
*/
@@ -3548,12 +3554,29 @@ static void VdpauMixerSetup(VdpauDecoder * decoder)
Debug(3, "video/vdpau: sharpness level %+1.3f\n", sharpness_level);
}
+ if (decoder->InputWidth > 1280 || decoder->InputHeight > 576) {
+ // HDTV
+ color_standard = VDP_COLOR_STANDARD_ITUR_BT_709;
+ Debug(3, "video/vdpau: color space ITU-R BT.709\n");
+ } else {
+ // SDTV
+ color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
+ Debug(3, "video/vdpau: color space ITU-R BT.601\n");
+ }
+
+ status =
+ VdpauGenerateCSCMatrix(&decoder->Procamp, color_standard, csc_matrix);
+ if (status != VDP_STATUS_OK) {
+ Error(_("video/vdpau: can't generate CSC matrix: %s\n"),
+ VdpauGetErrorString(status));
+ }
+
+ attributes[attribute_n] = VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX;
+ attribute_value_ptrs[attribute_n++] = csc_matrix;
+
VdpauVideoMixerSetAttributeValues(decoder->VideoMixer, attribute_n,
attributes, attribute_value_ptrs);
-
- //VdpColorStandard color_standard;
- //color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
- //VdpGenerateCSCMatrix(procamp, standard, &csc_matrix);
+ // FIXME: check status
}
///
@@ -3606,6 +3629,13 @@ static VdpauDecoder *VdpauNewDecoder(void)
decoder->OutputWidth = VideoWindowWidth;
decoder->OutputHeight = VideoWindowHeight;
+ // Procamp operation parameterization data
+ decoder->Procamp.struct_version = VDP_PROCAMP_VERSION;
+ decoder->Procamp.brightness = 0.0;
+ decoder->Procamp.contrast = 1.0;
+ decoder->Procamp.saturation = 1.0;
+ decoder->Procamp.hue = 0.0; // default values
+
#ifdef noDEBUG
// FIXME: for play
decoder->OutputX = 40;