radeon/vce: use util function to get h264 profile idc
[mesa.git] / src / gallium / drivers / radeon / radeon_vce_40_2_2.c
1 /**************************************************************************
2 *
3 * Copyright 2013 Advanced Micro Devices, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #include <stdio.h>
29
30 #include "pipe/p_video_codec.h"
31
32 #include "util/u_video.h"
33 #include "util/u_memory.h"
34
35 #include "vl/vl_video_buffer.h"
36
37 #include "si_pipe.h"
38 #include "radeon_video.h"
39 #include "radeon_vce.h"
40
41 static void session(struct rvce_encoder *enc)
42 {
43 RVCE_BEGIN(0x00000001); // session cmd
44 RVCE_CS(enc->stream_handle);
45 RVCE_END();
46 }
47
48 static void task_info(struct rvce_encoder *enc, uint32_t op,
49 uint32_t dep, uint32_t fb_idx, uint32_t ring_idx)
50 {
51 RVCE_BEGIN(0x00000002); // task info
52 if (op == 0x3) {
53 if (enc->task_info_idx) {
54 uint32_t offs = enc->cs->current.cdw - enc->task_info_idx + 3;
55 // Update offsetOfNextTaskInfo
56 enc->cs->current.buf[enc->task_info_idx] = offs;
57 }
58 enc->task_info_idx = enc->cs->current.cdw;
59 }
60 RVCE_CS(0xffffffff); // offsetOfNextTaskInfo
61 RVCE_CS(op); // taskOperation
62 RVCE_CS(dep); // referencePictureDependency
63 RVCE_CS(0x00000000); // collocateFlagDependency
64 RVCE_CS(fb_idx); // feedbackIndex
65 RVCE_CS(ring_idx); // videoBitstreamRingIndex
66 RVCE_END();
67 }
68
69 static void feedback(struct rvce_encoder *enc)
70 {
71 RVCE_BEGIN(0x05000005); // feedback buffer
72 RVCE_WRITE(enc->fb->res->buf, enc->fb->res->domains, 0x0); // feedbackRingAddressHi/Lo
73 RVCE_CS(0x00000001); // feedbackRingSize
74 RVCE_END();
75 }
76
77 static void create(struct rvce_encoder *enc)
78 {
79 enc->task_info(enc, 0x00000000, 0, 0, 0);
80
81 RVCE_BEGIN(0x01000001); // create cmd
82 RVCE_CS(0x00000000); // encUseCircularBuffer
83 RVCE_CS(u_get_h264_profile_idc(enc->base.profile)); // encProfile
84 RVCE_CS(enc->base.level); // encLevel
85 RVCE_CS(0x00000000); // encPicStructRestriction
86 RVCE_CS(enc->base.width); // encImageWidth
87 RVCE_CS(enc->base.height); // encImageHeight
88 RVCE_CS(enc->luma->u.legacy.level[0].nblk_x * enc->luma->bpe); // encRefPicLumaPitch
89 RVCE_CS(enc->chroma->u.legacy.level[0].nblk_x * enc->chroma->bpe); // encRefPicChromaPitch
90 RVCE_CS(align(enc->luma->u.legacy.level[0].nblk_y, 16) / 8); // encRefYHeightInQw
91 RVCE_CS(0x00000000); // encRefPic(Addr|Array)Mode, encPicStructRestriction, disableRDO
92 RVCE_END();
93 }
94
95 static void rate_control(struct rvce_encoder *enc)
96 {
97 RVCE_BEGIN(0x04000005); // rate control
98 RVCE_CS(enc->pic.rate_ctrl.rate_ctrl_method); // encRateControlMethod
99 RVCE_CS(enc->pic.rate_ctrl.target_bitrate); // encRateControlTargetBitRate
100 RVCE_CS(enc->pic.rate_ctrl.peak_bitrate); // encRateControlPeakBitRate
101 RVCE_CS(enc->pic.rate_ctrl.frame_rate_num); // encRateControlFrameRateNum
102 RVCE_CS(0x00000000); // encGOPSize
103 RVCE_CS(enc->pic.quant_i_frames); // encQP_I
104 RVCE_CS(enc->pic.quant_p_frames); // encQP_P
105 RVCE_CS(enc->pic.quant_b_frames); // encQP_B
106 RVCE_CS(enc->pic.rate_ctrl.vbv_buffer_size); // encVBVBufferSize
107 RVCE_CS(enc->pic.rate_ctrl.frame_rate_den); // encRateControlFrameRateDen
108 RVCE_CS(0x00000000); // encVBVBufferLevel
109 RVCE_CS(0x00000000); // encMaxAUSize
110 RVCE_CS(0x00000000); // encQPInitialMode
111 RVCE_CS(enc->pic.rate_ctrl.target_bits_picture); // encTargetBitsPerPicture
112 RVCE_CS(enc->pic.rate_ctrl.peak_bits_picture_integer); // encPeakBitsPerPictureInteger
113 RVCE_CS(enc->pic.rate_ctrl.peak_bits_picture_fraction); // encPeakBitsPerPictureFractional
114 RVCE_CS(0x00000000); // encMinQP
115 RVCE_CS(0x00000033); // encMaxQP
116 RVCE_CS(0x00000000); // encSkipFrameEnable
117 RVCE_CS(0x00000000); // encFillerDataEnable
118 RVCE_CS(0x00000000); // encEnforceHRD
119 RVCE_CS(0x00000000); // encBPicsDeltaQP
120 RVCE_CS(0x00000000); // encReferenceBPicsDeltaQP
121 RVCE_CS(0x00000000); // encRateControlReInitDisable
122 RVCE_END();
123 }
124
125 static void config_extension(struct rvce_encoder *enc)
126 {
127 RVCE_BEGIN(0x04000001); // config extension
128 RVCE_CS(0x00000003); // encEnablePerfLogging
129 RVCE_END();
130 }
131
132 static void pic_control(struct rvce_encoder *enc)
133 {
134 unsigned encNumMBsPerSlice;
135
136 encNumMBsPerSlice = align(enc->base.width, 16) / 16;
137 encNumMBsPerSlice *= align(enc->base.height, 16) / 16;
138
139 RVCE_BEGIN(0x04000002); // pic control
140 RVCE_CS(0x00000000); // encUseConstrainedIntraPred
141 RVCE_CS(0x00000000); // encCABACEnable
142 RVCE_CS(0x00000000); // encCABACIDC
143 RVCE_CS(0x00000000); // encLoopFilterDisable
144 RVCE_CS(0x00000000); // encLFBetaOffset
145 RVCE_CS(0x00000000); // encLFAlphaC0Offset
146 RVCE_CS(0x00000000); // encCropLeftOffset
147 RVCE_CS((align(enc->base.width, 16) - enc->base.width) >> 1); // encCropRightOffset
148 RVCE_CS(0x00000000); // encCropTopOffset
149 RVCE_CS((align(enc->base.height, 16) - enc->base.height) >> 1); // encCropBottomOffset
150 RVCE_CS(encNumMBsPerSlice); // encNumMBsPerSlice
151 RVCE_CS(0x00000000); // encIntraRefreshNumMBsPerSlot
152 RVCE_CS(0x00000000); // encForceIntraRefresh
153 RVCE_CS(0x00000000); // encForceIMBPeriod
154 RVCE_CS(0x00000000); // encPicOrderCntType
155 RVCE_CS(0x00000000); // log2_max_pic_order_cnt_lsb_minus4
156 RVCE_CS(0x00000000); // encSPSID
157 RVCE_CS(0x00000000); // encPPSID
158 RVCE_CS(0x00000040); // encConstraintSetFlags
159 RVCE_CS(MAX2(enc->base.max_references, 1) - 1); // encBPicPattern
160 RVCE_CS(0x00000000); // weightPredModeBPicture
161 RVCE_CS(MIN2(enc->base.max_references, 2)); // encNumberOfReferenceFrames
162 RVCE_CS(enc->base.max_references + 1); // encMaxNumRefFrames
163 RVCE_CS(0x00000001); // encNumDefaultActiveRefL0
164 RVCE_CS(0x00000001); // encNumDefaultActiveRefL1
165 RVCE_CS(0x00000000); // encSliceMode
166 RVCE_CS(0x00000000); // encMaxSliceSize
167 RVCE_END();
168 }
169
170 static void motion_estimation(struct rvce_encoder *enc)
171 {
172 RVCE_BEGIN(0x04000007); // motion estimation
173 RVCE_CS(0x00000001); // encIMEDecimationSearch
174 RVCE_CS(0x00000001); // motionEstHalfPixel
175 RVCE_CS(0x00000000); // motionEstQuarterPixel
176 RVCE_CS(0x00000000); // disableFavorPMVPoint
177 RVCE_CS(0x00000000); // forceZeroPointCenter
178 RVCE_CS(0x00000000); // LSMVert
179 RVCE_CS(0x00000010); // encSearchRangeX
180 RVCE_CS(0x00000010); // encSearchRangeY
181 RVCE_CS(0x00000010); // encSearch1RangeX
182 RVCE_CS(0x00000010); // encSearch1RangeY
183 RVCE_CS(0x00000000); // disable16x16Frame1
184 RVCE_CS(0x00000000); // disableSATD
185 RVCE_CS(0x00000000); // enableAMD
186 RVCE_CS(0x000000fe); // encDisableSubMode
187 RVCE_CS(0x00000000); // encIMESkipX
188 RVCE_CS(0x00000000); // encIMESkipY
189 RVCE_CS(0x00000000); // encEnImeOverwDisSubm
190 RVCE_CS(0x00000000); // encImeOverwDisSubmNo
191 RVCE_CS(0x00000001); // encIME2SearchRangeX
192 RVCE_CS(0x00000001); // encIME2SearchRangeY
193 RVCE_CS(0x00000000); // parallelModeSpeedupEnable
194 RVCE_CS(0x00000000); // fme0_encDisableSubMode
195 RVCE_CS(0x00000000); // fme1_encDisableSubMode
196 RVCE_CS(0x00000000); // imeSWSpeedupEnable
197 RVCE_END();
198 }
199
200 static void rdo(struct rvce_encoder *enc)
201 {
202 RVCE_BEGIN(0x04000008); // rdo
203 RVCE_CS(0x00000000); // encDisableTbePredIFrame
204 RVCE_CS(0x00000000); // encDisableTbePredPFrame
205 RVCE_CS(0x00000000); // useFmeInterpolY
206 RVCE_CS(0x00000000); // useFmeInterpolUV
207 RVCE_CS(0x00000000); // useFmeIntrapolY
208 RVCE_CS(0x00000000); // useFmeIntrapolUV
209 RVCE_CS(0x00000000); // useFmeInterpolY_1
210 RVCE_CS(0x00000000); // useFmeInterpolUV_1
211 RVCE_CS(0x00000000); // useFmeIntrapolY_1
212 RVCE_CS(0x00000000); // useFmeIntrapolUV_1
213 RVCE_CS(0x00000000); // enc16x16CostAdj
214 RVCE_CS(0x00000000); // encSkipCostAdj
215 RVCE_CS(0x00000000); // encForce16x16skip
216 RVCE_CS(0x00000000); // encDisableThresholdCalcA
217 RVCE_CS(0x00000000); // encLumaCoeffCost
218 RVCE_CS(0x00000000); // encLumaMBCoeffCost
219 RVCE_CS(0x00000000); // encChromaCoeffCost
220 RVCE_END();
221 }
222
223 static void vui(struct rvce_encoder *enc)
224 {
225 int i;
226
227 if (!enc->pic.rate_ctrl.frame_rate_num)
228 return;
229
230 RVCE_BEGIN(0x04000009); // vui
231 RVCE_CS(0x00000000); //aspectRatioInfoPresentFlag
232 RVCE_CS(0x00000000); //aspectRatioInfo.aspectRatioIdc
233 RVCE_CS(0x00000000); //aspectRatioInfo.sarWidth
234 RVCE_CS(0x00000000); //aspectRatioInfo.sarHeight
235 RVCE_CS(0x00000000); //overscanInfoPresentFlag
236 RVCE_CS(0x00000000); //overScanInfo.overscanAppropFlag
237 RVCE_CS(0x00000000); //videoSignalTypePresentFlag
238 RVCE_CS(0x00000005); //videoSignalTypeInfo.videoFormat
239 RVCE_CS(0x00000000); //videoSignalTypeInfo.videoFullRangeFlag
240 RVCE_CS(0x00000000); //videoSignalTypeInfo.colorDescriptionPresentFlag
241 RVCE_CS(0x00000002); //videoSignalTypeInfo.colorPrim
242 RVCE_CS(0x00000002); //videoSignalTypeInfo.transferChar
243 RVCE_CS(0x00000002); //videoSignalTypeInfo.matrixCoef
244 RVCE_CS(0x00000000); //chromaLocInfoPresentFlag
245 RVCE_CS(0x00000000); //chromaLocInfo.chromaLocTop
246 RVCE_CS(0x00000000); //chromaLocInfo.chromaLocBottom
247 RVCE_CS(0x00000001); //timingInfoPresentFlag
248 RVCE_CS(enc->pic.rate_ctrl.frame_rate_den); //timingInfo.numUnitsInTick
249 RVCE_CS(enc->pic.rate_ctrl.frame_rate_num * 2); //timingInfo.timeScale;
250 RVCE_CS(0x00000001); //timingInfo.fixedFrameRateFlag
251 RVCE_CS(0x00000000); //nalHRDParametersPresentFlag
252 RVCE_CS(0x00000000); //hrdParam.cpbCntMinus1
253 RVCE_CS(0x00000004); //hrdParam.bitRateScale
254 RVCE_CS(0x00000006); //hrdParam.cpbSizeScale
255 for (i = 0; i < 32; i++) {
256 RVCE_CS(0x00000000); //hrdParam.bitRateValueMinus
257 RVCE_CS(0x00000000); //hrdParam.cpbSizeValueMinus
258 RVCE_CS(0x00000000); //hrdParam.cbrFlag
259 }
260 RVCE_CS(0x00000017); //hrdParam.initialCpbRemovalDelayLengthMinus1
261 RVCE_CS(0x00000017); //hrdParam.cpbRemovalDelayLengthMinus1
262 RVCE_CS(0x00000017); //hrdParam.dpbOutputDelayLengthMinus1
263 RVCE_CS(0x00000018); //hrdParam.timeOffsetLength
264 RVCE_CS(0x00000000); //lowDelayHRDFlag
265 RVCE_CS(0x00000000); //picStructPresentFlag
266 RVCE_CS(0x00000000); //bitstreamRestrictionPresentFlag
267 RVCE_CS(0x00000001); //bitstreamRestrictions.motionVectorsOverPicBoundariesFlag
268 RVCE_CS(0x00000002); //bitstreamRestrictions.maxBytesPerPicDenom
269 RVCE_CS(0x00000001); //bitstreamRestrictions.maxBitsPerMbDenom
270 RVCE_CS(0x00000010); //bitstreamRestrictions.log2MaxMvLengthHori
271 RVCE_CS(0x00000010); //bitstreamRestrictions.log2MaxMvLengthVert
272 RVCE_CS(0x00000003); //bitstreamRestrictions.numReorderFrames
273 RVCE_CS(0x00000003); //bitstreamRestrictions.maxDecFrameBuffering
274 RVCE_END();
275 }
276
277 static void config(struct rvce_encoder *enc)
278 {
279 enc->task_info(enc, 0x00000002, 0, 0xffffffff, 0);
280 enc->rate_control(enc);
281 enc->config_extension(enc);
282 enc->motion_estimation(enc);
283 enc->rdo(enc);
284 if (enc->use_vui)
285 enc->vui(enc);
286 enc->pic_control(enc);
287 }
288
289 static void encode(struct rvce_encoder *enc)
290 {
291 signed luma_offset, chroma_offset;
292 int i;
293
294 enc->task_info(enc, 0x00000003, 0, 0, 0);
295
296 RVCE_BEGIN(0x05000001); // context buffer
297 RVCE_READWRITE(enc->cpb.res->buf, enc->cpb.res->domains, 0x0); // encodeContextAddressHi/Lo
298 RVCE_END();
299
300 RVCE_BEGIN(0x05000004); // video bitstream buffer
301 RVCE_WRITE(enc->bs_handle, RADEON_DOMAIN_GTT, 0x0); // videoBitstreamRingAddressHi/Lo
302 RVCE_CS(enc->bs_size); // videoBitstreamRingSize
303 RVCE_END();
304
305 RVCE_BEGIN(0x03000001); // encode
306 RVCE_CS(0x00000000); // insertHeaders
307 RVCE_CS(0x00000000); // pictureStructure
308 RVCE_CS(enc->bs_size); // allowedMaxBitstreamSize
309 RVCE_CS(0x00000000); // forceRefreshMap
310 RVCE_CS(0x00000000); // insertAUD
311 RVCE_CS(0x00000000); // endOfSequence
312 RVCE_CS(0x00000000); // endOfStream
313 RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
314 enc->luma->u.legacy.level[0].offset); // inputPictureLumaAddressHi/Lo
315 RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
316 enc->chroma->u.legacy.level[0].offset); // inputPictureChromaAddressHi/Lo
317 RVCE_CS(align(enc->luma->u.legacy.level[0].nblk_y, 16)); // encInputFrameYPitch
318 RVCE_CS(enc->luma->u.legacy.level[0].nblk_x * enc->luma->bpe); // encInputPicLumaPitch
319 RVCE_CS(enc->chroma->u.legacy.level[0].nblk_x * enc->chroma->bpe); // encInputPicChromaPitch
320 RVCE_CS(0x00000000); // encInputPic(Addr|Array)Mode
321 RVCE_CS(0x00000000); // encInputPicTileConfig
322 RVCE_CS(enc->pic.picture_type); // encPicType
323 RVCE_CS(enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_IDR); // encIdrFlag
324 RVCE_CS(0x00000000); // encIdrPicId
325 RVCE_CS(0x00000000); // encMGSKeyPic
326 RVCE_CS(!enc->pic.not_referenced); // encReferenceFlag
327 RVCE_CS(0x00000000); // encTemporalLayerIndex
328 RVCE_CS(0x00000000); // num_ref_idx_active_override_flag
329 RVCE_CS(0x00000000); // num_ref_idx_l0_active_minus1
330 RVCE_CS(0x00000000); // num_ref_idx_l1_active_minus1
331
332 i = enc->pic.frame_num - enc->pic.ref_idx_l0;
333 if (i > 1 && enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_P) {
334 RVCE_CS(0x00000001); // encRefListModificationOp
335 RVCE_CS(i - 1); // encRefListModificationNum
336 } else {
337 RVCE_CS(0x00000000); // encRefListModificationOp
338 RVCE_CS(0x00000000); // encRefListModificationNum
339 }
340
341 for (i = 0; i < 3; ++i) {
342 RVCE_CS(0x00000000); // encRefListModificationOp
343 RVCE_CS(0x00000000); // encRefListModificationNum
344 }
345 for (i = 0; i < 4; ++i) {
346 RVCE_CS(0x00000000); // encDecodedPictureMarkingOp
347 RVCE_CS(0x00000000); // encDecodedPictureMarkingNum
348 RVCE_CS(0x00000000); // encDecodedPictureMarkingIdx
349 RVCE_CS(0x00000000); // encDecodedRefBasePictureMarkingOp
350 RVCE_CS(0x00000000); // encDecodedRefBasePictureMarkingNum
351 }
352
353 // encReferencePictureL0[0]
354 RVCE_CS(0x00000000); // pictureStructure
355 if(enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_P ||
356 enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_B) {
357 struct rvce_cpb_slot *l0 = si_l0_slot(enc);
358 si_vce_frame_offset(enc, l0, &luma_offset, &chroma_offset);
359 RVCE_CS(l0->picture_type); // encPicType
360 RVCE_CS(l0->frame_num); // frameNumber
361 RVCE_CS(l0->pic_order_cnt); // pictureOrderCount
362 RVCE_CS(luma_offset); // lumaOffset
363 RVCE_CS(chroma_offset); // chromaOffset
364 } else {
365 RVCE_CS(0x00000000); // encPicType
366 RVCE_CS(0x00000000); // frameNumber
367 RVCE_CS(0x00000000); // pictureOrderCount
368 RVCE_CS(0xffffffff); // lumaOffset
369 RVCE_CS(0xffffffff); // chromaOffset
370 }
371
372 // encReferencePictureL0[1]
373 RVCE_CS(0x00000000); // pictureStructure
374 RVCE_CS(0x00000000); // encPicType
375 RVCE_CS(0x00000000); // frameNumber
376 RVCE_CS(0x00000000); // pictureOrderCount
377 RVCE_CS(0xffffffff); // lumaOffset
378 RVCE_CS(0xffffffff); // chromaOffset
379
380 // encReferencePictureL1[0]
381 RVCE_CS(0x00000000); // pictureStructure
382 if(enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_B) {
383 struct rvce_cpb_slot *l1 = si_l1_slot(enc);
384 si_vce_frame_offset(enc, l1, &luma_offset, &chroma_offset);
385 RVCE_CS(l1->picture_type); // encPicType
386 RVCE_CS(l1->frame_num); // frameNumber
387 RVCE_CS(l1->pic_order_cnt); // pictureOrderCount
388 RVCE_CS(luma_offset); // lumaOffset
389 RVCE_CS(chroma_offset); // chromaOffset
390 } else {
391 RVCE_CS(0x00000000); // encPicType
392 RVCE_CS(0x00000000); // frameNumber
393 RVCE_CS(0x00000000); // pictureOrderCount
394 RVCE_CS(0xffffffff); // lumaOffset
395 RVCE_CS(0xffffffff); // chromaOffset
396 }
397
398 si_vce_frame_offset(enc, si_current_slot(enc), &luma_offset, &chroma_offset);
399 RVCE_CS(luma_offset); // encReconstructedLumaOffset
400 RVCE_CS(chroma_offset); // encReconstructedChromaOffset
401 RVCE_CS(0x00000000); // encColocBufferOffset
402 RVCE_CS(0x00000000); // encReconstructedRefBasePictureLumaOffset
403 RVCE_CS(0x00000000); // encReconstructedRefBasePictureChromaOffset
404 RVCE_CS(0x00000000); // encReferenceRefBasePictureLumaOffset
405 RVCE_CS(0x00000000); // encReferenceRefBasePictureChromaOffset
406 RVCE_CS(0x00000000); // pictureCount
407 RVCE_CS(enc->pic.frame_num); // frameNumber
408 RVCE_CS(enc->pic.pic_order_cnt); // pictureOrderCount
409 RVCE_CS(0x00000000); // numIPicRemainInRCGOP
410 RVCE_CS(0x00000000); // numPPicRemainInRCGOP
411 RVCE_CS(0x00000000); // numBPicRemainInRCGOP
412 RVCE_CS(0x00000000); // numIRPicRemainInRCGOP
413 RVCE_CS(0x00000000); // enableIntraRefresh
414 RVCE_END();
415 }
416
417 static void destroy(struct rvce_encoder *enc)
418 {
419 enc->task_info(enc, 0x00000001, 0, 0, 0);
420
421 feedback(enc);
422
423 RVCE_BEGIN(0x02000001); // destroy
424 RVCE_END();
425 }
426
427 void si_vce_40_2_2_get_param(struct rvce_encoder *enc, struct pipe_h264_enc_picture_desc *pic)
428 {
429 }
430
431 void si_vce_40_2_2_init(struct rvce_encoder *enc)
432 {
433 enc->session = session;
434 enc->task_info = task_info;
435 enc->create = create;
436 enc->feedback = feedback;
437 enc->rate_control = rate_control;
438 enc->config_extension = config_extension;
439 enc->pic_control = pic_control;
440 enc->motion_estimation = motion_estimation;
441 enc->rdo = rdo;
442 enc->vui = vui;
443 enc->config = config;
444 enc->encode = encode;
445 enc->destroy = destroy;
446 }