summaryrefslogtreecommitdiff
path: root/src/gen8_mfc.c
AgeCommit message (Collapse)AuthorFilesLines
2017-02-18PROJECT HAS MOVEDHEADmasterSean V Kelley1-4615/+0
See https://github.com/01org/intel-vaapi-driver Signed-off-by: Sean V Kelley <seanvk@posteo.de>
2017-01-17Fix the incorrect 48-bit address reallocationZhao Yakui1-43/+30
Currently it works well for 32-bit address. But it will cause that the upper 32-bit address is incorrect if the 48-bit address buffer is allocated. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
2017-01-17Follow the HW spec to configure the buffer cache on Gen9+Zhao Yakui1-14/+19
The MOCS field is used to define the cache type for the given buffer. From the SKL+, the MOCS field is interpreted as the index that is used to find the corresponding cache type in kernel driver. The current MOCS setting causes that buffer uses the wrong cache type. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Sean V Kelley <sean.v.kelley@intel.com>
2017-01-17Fix the incorrect configuration of media_pipeline power domainZhao Yakui1-2/+3
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
2017-01-17H264 Encoding:Free aux_batchbuffer to configure access domain correctly for ↵Zhao Yakui1-2/+5
PAK_OBJ command buffer The access domain is not configured correctly for PAK_OBJ command buffer. And it causes that the buffer content is not synchronized correctly. At the same time the 64-byte is aligned for the boundary between CPU and GPU access instead of 16-byte. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
2017-01-10H.264 encoder: add a simple reactive VBR rate control modeMark Thompson1-5/+5
This implements a simple reactive VBR rate control mode for single-layer H.264. The primary aim here is to avoid the problematic behaviour that the CBR rate controller displays on scene changes, where the QP can get pushed up by a large amount in a short period and compromise the quality of following frames to a very visible degree. The main idea, then, is to try to keep the HRD buffering above the target level most of the time, so that when a large frame is generated (on a scene change or when the stream complexity increases) we have plenty of slack to be able to encode the more difficult region without compromising quality immediately on the following frames. It is optimistic about the complexity of future frames, so even after generating one or more large frames on a significant change it will try to keep the QP at its current level until the HRD buffer bounds force a change to maintain the intended rate. Compared to the CBR rate controller, it keeps the quality level much more stable - QP does not always spike up as large frames are generated when the complexity of the stream increases transiently, but equally it does not reduce as quickly when the complexity of the stream decreases. Signed-off-by: Mark Thompson <sw@jkqxz.net>
2016-12-23VP8 encoder: use generic rate control parametersMark Thompson1-56/+17
Signed-off-by: Mark Thompson <sw@jkqxz.net> Reviewed-by: Xiang, Haihao<haihao.xiang@intel.com>
2016-11-21Use obtained eu_counts to configure GPU media pipeline on Gen8/Gen9Zhao Yakui1-1/+5
If it is not supported, it will fall back to the original config. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Charles Daniel <daniel.charles@intel.com>
2016-11-18Move sampler state related settings to the inner structure in i965_gpe_contextXiang, Haihao1-1/+2
User can set sampler entry size and the number of sampler entries now. sampler.bo is always set even if the sampler state is a part of the dynamic state buffer, hence we can use the corresponding settings no matter sampler state is a part of the dynamic state buffer or not. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-11-18Move interface descriptor remapping table related settings to the inner ↵Xiang, Haihao1-3/+4
structure in i965_gpe_context This patch delete idrt_size and use (idrt.max_entries * idrt.entry_size) instead. idrt.bo is always set even if the interface descriptor remapping table is a part of the dynamic state buffer, hence we can use the corresponding settings no matter this table is a part of the dynamic state buffer or not. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-11-18Move all curbe related settings to the inner structure in i965_gpe_contextXiang, Haihao1-1/+1
To avoid confusion between curbe.length and curbe_size, this patch uses curbe.length only. curbe.bo is always set even if curbe is a part of the dynamic state buffer, hence we can use curbe related settings no matter it is a part of the dynamic state buffer or not. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-10-27svct: hrd check per layerXiang, Haihao1-12/+12
Hence we can use separate parameters to estimate QP per layer and get more accurate QP for next frame in the same layer. Tested-by: Wang, Fei W <fei.w.wang@intel.com> Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
2016-10-24svct: Save the frame numbers for each frame type in a GOP per layerXiang, Haihao1-3/+3
Use the right frame numbers in a GOP to estimate a QP for next frame Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
2016-10-24svct: Usa an array to store QP rounding accumulatorXiang, Haihao1-5/+5
We can do QP compensation per layer. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
2016-09-16Update CBR algo for H.264 per tempolar layerXiang, Haihao1-2/+2
v2: rebased Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Tested-by: Luo, Focus <focus.luo@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-09-16Use arrays to store BRC related parameters per temporal layerXiang, Haihao1-23/+23
Currently only the first element is used v2: rebased Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Tested-by: Luo, Focus <focus.luo@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-09-16Change the type of the 2nd parameter of intel_mfc_update_hrd()Xiang, Haihao1-4/+5
In addition, change the two caller functions as well. v2: rebased Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Tested-by: Luo, Focus <focus.luo@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-09-16Use a 2-dimensional array to store misc parametersXiang, Haihao1-3/+3
This patch allows multiple misc parameter buffers for the same type within the same Begin/Render/End sequence in the future. Currently only the first element for each misc type is used, so it doesn't change any functionality yet. v2: rebased Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Tested-by: Luo, Focus <focus.luo@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-09-16move QpPrimeY to another inner structure for H.264/VP8 BRCXiang, Haihao1-19/+19
It doesn't cause functionality change v2: rebased Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Tested-by: Luo, Focus <focus.luo@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-09-16Remove unused fields and code in H.264/VP8 BRCXiang, Haihao1-32/+3
H.264 and VP8 share some data structures v2: rebased Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Tested-by: Luo, Focus <focus.luo@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2016-08-19Remove unused fields in struct encode_stateXiang, Haihao1-1/+1
It also fixes a wrong assert() in gen8_mfc.c v2: Correct condition code when removing used fields Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
2016-08-15scaling matrix of h264 encoder on gen7/gen7.5/gen8/gen9Jia Meng1-30/+92
v1: change the title according to yakui's comments. qm is in raster scan order per va api, and fqm is in column wise raster scan order per hardware requirement. Signed-off-by: Jia Meng <jia.meng@intel.com> Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
2016-08-15ROI:enable on gen8 and gen9Pengfei Qu1-16/+37
v2: use ASSERT_RET to check the ROI flag setted by user. instead of assert. v1: ROI enable on gen8 and gen9 Enable GPU to construct GPU command under ROI scenario fix roi attrib config incorrectly Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
2016-08-10gen8_mfc: fix memory leak during vp8 encodingHyunjun Ko1-0/+1
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=97272 Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
2016-06-13Encoding: H264 uses the GPU to construct the PAK obj command on Gen8+Zhao Yakui1-196/+192
This is helpful to reduce the waiting time when preparing the command buffer of PAK object. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2016-06-13Encoding: Encoding reuses aux_batchbuffer instead of allocate new bufferZhao Yakui1-16/+7
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2015-09-06Clean up unused local variable 'i965'Lim Siew Hoon1-3/+0
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
2015-09-06Fix suspiciously placed semicolon at if statement.Lim Siew Hoon1-2/+2
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
2015-09-06Fix memset initialize for huff_co_table and huff_si_table arrayLim Siew Hoon1-2/+2
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
2015-09-06Fix memset initialize value for huff_size_table and huff_code_tableLim Siew Hoon1-2/+2
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
2015-09-06Fix klockwork critical message hit on calloc function usageLim Siew Hoon1-1/+1
The calloc function maybe return NULL, it will causing memory access violation if continue using NULL C structure. Add assert function to do checking on its. bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91699 Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
2015-05-22VP8 HWEnc: Init CBR QP at begining of gen8_mfc_vp8_initZhong Li1-0/+13
Initialize CBR QP at begining of gen8_mfc_vp8_init(), because this funtion will use qp to init prob_skip_false. Signed-off-by: Zhong Li <zhong.li@intel.com>
2015-05-07VP8 HWEnc: Fix vp8 mv incorrectly stored issueZhong Li1-2/+5
As vp8 spec, all luma motion vectors are doubled stored. This patch has much benefit to P frame qualtity. Signed-off-by: Zhong Li <zhong.li@intel.com>
2015-04-29VP8 HWEnc: Alloc larger memory for internal bufferZhong Li1-2/+2
It is to prevent the internal bitstream buffer overflow when qp is low. Signed-off-by: Zhong Li <zhong.li@intel.com>
2015-04-29VP8 HWEnc: Add CBR SupportZhong Li1-8/+351
Add bit rate control (CBR) for vp8 hw encoding v1->v2: follow haihao's comment to update this patch Signed-off-by: Zhong Li <zhong.li@intel.com>
2015-03-26Fix the quality factor.Sirisha Muppavarapu1-3/+13
The following are added in this commit: 1) Added lower bound to the quality factor. 2) Added extensive comments on scaling and normalization of the quality factor.
2015-03-19VP8 HWEnc: Add BSW VP8 HWEnc supportZhong Li1-4/+913
Add BSW vp8 encoding support, and let SKL and BDW use the same PAK pipeline. Signed-off-by: Zhong Li <zhong.li@intel.com> (cherry picked from commit c2be56ae6f3628ea246a1dd02e5cac18da84df56)
2015-03-09jpeg_enc: Fix the column raster conversion of quatization matrix.Sreerenj Balachandran1-5/+5
Use temp array for the new raster order calculation, otherwise it simply generate wrong values. Note: There is opportunity for more optimization, for eg we can avoid the usage of mulitple for loops here and there. Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com> Reviewed-by: Sirisha Muppavarapu <sirisha.muppavarapu@intel.com>
2015-03-09jpeg_enc: Fix the quatisation matrix scaling.Sreerenj Balachandran1-2/+2
The misplaced parentheses are causing wrong value assignment to the quatization matrix. This will allow the ecoding when quality > 50. Otherwise it will simply generate garbage in encoded video for any quality factor greater than 50 Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com> Reviewed-by: Sirisha Muppavarapu <sirisha.muppavarapu@intel.com>
2015-03-09jpeg_enc: Avoid integer overflow while doing quality factor scalingSreerenj Balachandran1-2/+4
For eg: The uint8_t will simple overflow if submitted quality factor is 1 (5000/1). Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com> Reviewed-by: Sirisha Muppavarapu <sirisha.muppavarapu@intel.com>
2014-12-14JPEG Encode: Added support for UYVY/YUY2/Y8 Input formatsSirisha Muppavarapu1-4/+7
Signed-off-by: Sirisha Muppavarapu <sirisha.muppavarapu@intel.com> (cherry picked from commit 2eb9a2037a05d742ee63638f3400b772f9a311e1)
2014-11-19JPEG Encode: Added JPEG Encode feature support for gen8Sirisha Muppavarapu1-11/+862
(cherry picked from commit d2984892694e2da72059419667e8839cb9513854)
2014-09-02H264_Encoding: Fix the incorrect Qp setting under CBR when slice_header is ↵Zhao Yakui1-5/+12
passed Fix the issue in https://bugs.freedesktop.org/show_bug.cgi?id=83143 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Tested-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com> (cherry picked from commit eca8e0065e3a04156e0817d3a5ac14f4df39d603) Conflicts: src/gen6_mfc.c src/gen8_mfc.c
2014-06-16H264_encoding: Don't update the slice qp for CBR mode when finding packed ↵Zhao, Yakui1-2/+4
slice_header data Otherwise the slice qp is inconsistent and the encoding is incorrect. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit 897527c30435202927e6cd05cd5189a710d02c91)
2014-06-16H264_Encoding: Add the support of packed slice header to be flexibleZhao, Yakui1-30/+0
Under some encoding scenario, the user hopes to generate the packed slice header data by themself and then the driver can insert the passed slice header packed data into the coded clip. 1.The VA_ENC_PACKED_HEADER_SLICE flag is exported and it is treated as optional. This is to say: if packed slice header data is passed, it will be inserted directly. If no packed slice header data is passed, the driver will help to generate it. 2.Another restriction is that the packed slice header data is inserted after the packed rawdata for one slice. That is to say: If it needs to insert the packed rawdata and slice header data, the packed rawdata will be inserted firstly(This is handled by the driver). Signed-off-by: Zhao, Yakui <yakui.zhao@intel.com> (cherry picked from commit 00111e8a8bfa67b971419b72577eaa1b9f47bc34) Conflicts: src/gen75_mfc.c src/gen8_mfc.c
2014-06-16H264_encoding: Add the support of inserting the packed raw data passed from userZhao, Yakui1-2/+4
Under some encoding scenario, the user-space application hopes that the driver can insert the passed packed rawdata into the coded clip. This is to allow the insertion of packed rawdata passed from user. As the position of packed rawdata is related with the slice. So the following restrictions are added: 1. the packed rawdata header type/data should be paired. 2. the packed rawdata data is inserted by following the passed order 3. the packed rawdata header type/data is split by using VAEncSliceParameterBuffer. That is to say: The packed rawdata for slice 0 should be passed before the first VAEncSliceParameterBuffer. After one VAEncSliceParameterBuffer is parsed, the subseuquent packed rawdata is for another new slice. The subsequent packed rawdata after the last VAEncSliceParameterBuffer is ignored. 4. it does not change the rule for the packed data of SPS/PPS/MISC type. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit 974597ef64dc9a283d4787e1484a75d1610414f4) Conflicts: src/gen75_mfc.c src/gen8_mfc.c
2014-06-16encoder: MVC: Add support for MVC profilesLi Xiaowei1-4/+9
This is a part of bd630edd844b88ea543a027654db296ff7da16cd on staging Signed-off-by: Li Xiaowei <xiaowei.a.li@intel.com> Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2014-04-23Use the VA_FOURCC_ABCD constant to replace the VA_FOURCC(A,B,C,D)Zhao Yakui1-1/+1
This is helpful to avoid the typo error when using VA_FOURCC(A, B, C, D). Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit acea969011bceee36a57fe2c0e4ee96c0c5e79c7)
2014-02-27Update the MFX_AVC_IMAGE_STATE to follow the specZhao Yakui1-1/+1
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2014-02-27Fix the incorrect MV upper bound setting of MFC_IND_OBJ_BASE_ADDRESS_STAE ↵Zhao Yakui1-1/+3
for encoding on gen8 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>