summaryrefslogtreecommitdiff
path: root/README
blob: c0fab3c9da83ad25d33228b2f8c83d4b4b6067aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

  libva-intel-driver
  VA driver for Intel G45 & HD Graphics family

  Copyright (C) 2009-2011 Intel Corporation


License
-------

Please read the COPYING file available in this package.


Overview
--------

libva-intel-driver is the VA-API implementation for Intel G45 chipsets
and Intel HD Graphics for Intel Core processor family.

Platform definitions:
CTG: Cantiga, Intel GMA 4500MHD (GM45)
ILK: Ironlake, Intel HD Graphics for 2010 Intel Core processor family
SNB: Sandybridge, Intel HD Graphics for 2011 Intel Core processor family
IVB: Ivybridge


Codecs
------

H.264   D   ILK+
H.264   E   SNB+
MPEG-2  D   CTG+
VC-1    D   SNB+


Requirements
------------

libva >= 1.0.16

------------
Extensional Video post-processing

Now this supports the extensional video post-processing based on OpenCL. If you
hope to use the extensional video post-processing, please add the following extra
configure option:
   --enable-opencl

As the extensional video post-processing is implemented based on OpenCL, please
make sure that the following components should be installed:
	opencl library: 
	ICD-ocl wrapper library and configuration(/etc/OpenCL/Vendors/intel.icd):

Section 1: How to use the extensional video post-processing

The following will describe how to use the extensional video post-processing.
Step A. query the filter of VAProcFilterExtVPP to decide whether the extensional
video post-processing is supported. If the VAProcFilterExtVPP is returned, it
indicates that the extensional video post-processing is supported.

Step B. Register the customed opencl kernel into the driver and the kernel ID
is returned for the next step
        vaRegisterExtVPPShader(display, context, vppext_shader *, &kernel_id);
        The vppext_shader is defined in the intel_vppext.h

	In order to register the opencl shader, the parameter of kernel should
follow the rules in src/opencl/opencl_kernel.txt. Otherwise it can't be
registered/executed as expected.
	Currently the driver will inline several shaders. And it can be
queried by using vaQueryVideoInlineExtVPP. The corresponding kernel ID is
also returned. 

Step C: Call the normal VPP calling sequence to do the extensional VPP
	>vaBeginPicture
	>vaRenderPicture
	>vaEndPicture
	
	The parameter for extensional VPP is passed by vaRenderPicture. And it
is defined libva/va/va_vpp.h(VAProcExtParameterBuffer). The returned kernel ID
in step B is used for the ocl_ext_typeid of VAProcExtParameterBuffer.

Of course currently the driver provides some demo examples about the
extensional video post-processing. After the driver is installed with
extensional VPP supported,we can see the corresponding effect by using 
mplayer command like the below:
	mplayer -vo vaapi:scaling=fast -va vaapi XXX
    And the INTEL_OCL environmental variable can be set to select which effect
is used.
      export INTEL_OCL="mirror": It will apply the mirror effect on the decoded image.
      export INTEL_OCL="blur": It will apply the blur effect on the decoded image.
      export INTEL_OCL="gray": It will apply the gray effect on the decoded image.
      export INTEL_OCL="pixelated" : It will apply the pixelated effect on decoded image.

Section 2: Usage note about the some APIs related with extensional VPP
     Currently the vaRegisterExtVPPShader/vaUnregisterExtVPPShader/
vaQueryVideoInlineExtVPP is defined as the driver-private API and they should
be obtained by using vaGetLibFunc().
The following is the example:
	The header file of intel_vppext.h is included.

	>vaRegisterExtVPPShader_FUNC vaRegisterExtVPPShader =
			vaGetLibFunc(dpy,"vaRegisterExtVPPShader");
	>vaUnregisterExtVPPShader_FUNC vaUnregisterExtVPPShader =
			vaGetLibFunc(dpy,"vaUnregisterExtVPPShader");
	>vaQueryVideoInlineExtVPP_FUNC vaQueryVideInlineExtVPP =
			vaGetLibFunc(dpy,"vaQueryVideoInlineExtVPP");

Section 3: How to add one inline extennsional VPP shader

The following section will describe how to add one inlined extensional VPP
shader
       1. Please follow the rules in src/opencl_kernel.txt and develop the
shader
       2. Put the shader into the directory of src/opencl/ and edit the
vpp_kernels array in src/vpp_opencl.c
       3. Use the vaQueryVideoInlineExtVPP to query the inlined GPU shader
and then follow the step in the section 1.
     
       Of course it also uses the hacked mechanism to check the corresponding
VPP effect without rewriting the application. 
	4. Add some code in src/i965_post_processing.c as the following:
		> if (!strcmp(ocl_test, "XXXX"))
			ocl_id = xxxx;
		Recompile the libva driver and install it.
	5. export INTEL_OCL="XXXX" and then use the corresponding command
mentioned in section 1 to check the VPP effect.

Cheers