radeon/vce: make reloc offset signed
[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 /*
29 * Authors:
30 * Christian König <christian.koenig@amd.com>
31 *
32 */
33
34 #include <stdio.h>
35
36 #include "pipe/p_video_codec.h"
37
38 #include "util/u_video.h"
39 #include "util/u_memory.h"
40
41 #include "vl/vl_video_buffer.h"
42
43 #include "r600_pipe_common.h"
44 #include "radeon_video.h"
45 #include "radeon_vce.h"
46
47 static const unsigned profiles[7] = { 66, 77, 88, 100, 110, 122, 244 };
48
49 static void session(struct rvce_encoder *enc)
50 {
51 RVCE_BEGIN(0x00000001); // session cmd
52 RVCE_CS(enc->stream_handle);
53 RVCE_END();
54 }
55
56 static void task_info(struct rvce_encoder *enc, uint32_t op,
57 uint32_t dep, uint32_t fb_idx, uint32_t ring_idx)
58 {
59 RVCE_BEGIN(0x00000002); // task info
60 if (op == 0x3) {
61 if (enc->task_info_idx) {
62 uint32_t offs = enc->cs->cdw - enc->task_info_idx + 3;
63 // Update offsetOfNextTaskInfo
64 enc->cs->buf[enc->task_info_idx] = offs;
65 }
66 enc->task_info_idx = enc->cs->cdw;
67 }
68 RVCE_CS(0xffffffff); // offsetOfNextTaskInfo
69 RVCE_CS(op); // taskOperation
70 RVCE_CS(dep); // referencePictureDependency
71 RVCE_CS(0x00000000); // collocateFlagDependency
72 RVCE_CS(fb_idx); // feedbackIndex
73 RVCE_CS(ring_idx); // videoBitstreamRingIndex
74 RVCE_END();
75 }
76
77 static void feedback(struct rvce_encoder *enc)
78 {
79 RVCE_BEGIN(0x05000005); // feedback buffer
80 RVCE_WRITE(enc->fb->res->cs_buf, enc->fb->res->domains, 0x0); // feedbackRingAddressHi/Lo
81 RVCE_CS(0x00000001); // feedbackRingSize
82 RVCE_END();
83 }
84
85 static void create(struct rvce_encoder *enc)
86 {
87 enc->task_info(enc, 0x00000000, 0, 0, 0);
88
89 RVCE_BEGIN(0x01000001); // create cmd
90 RVCE_CS(0x00000000); // encUseCircularBuffer
91 RVCE_CS(profiles[enc->base.profile -
92 PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE]); // encProfile
93 RVCE_CS(enc->base.level); // encLevel
94 RVCE_CS(0x00000000); // encPicStructRestriction
95 RVCE_CS(enc->base.width); // encImageWidth
96 RVCE_CS(enc->base.height); // encImageHeight
97 RVCE_CS(enc->luma->level[0].pitch_bytes); // encRefPicLumaPitch
98 RVCE_CS(enc->chroma->level[0].pitch_bytes); // encRefPicChromaPitch
99 RVCE_CS(align(enc->luma->npix_y, 16) / 8); // encRefYHeightInQw
100 RVCE_CS(0x00000000); // encRefPic(Addr|Array)Mode, encPicStructRestriction, disableRDO
101 RVCE_END();
102 }
103
104 static void rate_control(struct rvce_encoder *enc)
105 {
106 RVCE_BEGIN(0x04000005); // rate control
107 RVCE_CS(enc->pic.rate_ctrl.rate_ctrl_method); // encRateControlMethod
108 RVCE_CS(enc->pic.rate_ctrl.target_bitrate); // encRateControlTargetBitRate
109 RVCE_CS(enc->pic.rate_ctrl.peak_bitrate); // encRateControlPeakBitRate
110 RVCE_CS(enc->pic.rate_ctrl.frame_rate_num); // encRateControlFrameRateNum
111 RVCE_CS(0x00000000); // encGOPSize
112 RVCE_CS(enc->pic.quant_i_frames); // encQP_I
113 RVCE_CS(enc->pic.quant_p_frames); // encQP_P
114 RVCE_CS(enc->pic.quant_b_frames); // encQP_B
115 RVCE_CS(enc->pic.rate_ctrl.vbv_buffer_size); // encVBVBufferSize
116 RVCE_CS(enc->pic.rate_ctrl.frame_rate_den); // encRateControlFrameRateDen
117 RVCE_CS(0x00000000); // encVBVBufferLevel
118 RVCE_CS(0x00000000); // encMaxAUSize
119 RVCE_CS(0x00000000); // encQPInitialMode
120 RVCE_CS(enc->pic.rate_ctrl.target_bits_picture); // encTargetBitsPerPicture
121 RVCE_CS(enc->pic.rate_ctrl.peak_bits_picture_integer); // encPeakBitsPerPictureInteger
122 RVCE_CS(enc->pic.rate_ctrl.peak_bits_picture_fraction); // encPeakBitsPerPictureFractional
123 RVCE_CS(0x00000000); // encMinQP
124 RVCE_CS(0x00000033); // encMaxQP
125 RVCE_CS(0x00000000); // encSkipFrameEnable
126 RVCE_CS(0x00000000); // encFillerDataEnable
127 RVCE_CS(0x00000000); // encEnforceHRD
128 RVCE_CS(0x00000000); // encBPicsDeltaQP
129 RVCE_CS(0x00000000); // encReferenceBPicsDeltaQP
130 RVCE_CS(0x00000000); // encRateControlReInitDisable
131 RVCE_END();
132 }
133
134 static void config_extension(struct rvce_encoder *enc)
135 {
136 RVCE_BEGIN(0x04000001); // config extension
137 RVCE_CS(0x00000003); // encEnablePerfLogging
138 RVCE_END();
139 }
140
141 static void pic_control(struct rvce_encoder *enc)
142 {
143 unsigned encNumMBsPerSlice;
144
145 encNumMBsPerSlice = align(enc->base.width, 16) / 16;
146 encNumMBsPerSlice *= align(enc->base.height, 16) / 16;
147
148 RVCE_BEGIN(0x04000002); // pic control
149 RVCE_CS(0x00000000); // encUseConstrainedIntraPred
150 RVCE_CS(0x00000000); // encCABACEnable
151 RVCE_CS(0x00000000); // encCABACIDC
152 RVCE_CS(0x00000000); // encLoopFilterDisable
153 RVCE_CS(0x00000000); // encLFBetaOffset
154 RVCE_CS(0x00000000); // encLFAlphaC0Offset
155 RVCE_CS(0x00000000); // encCropLeftOffset
156 RVCE_CS((align(enc->base.width, 16) - enc->base.width) >> 1); // encCropRightOffset
157 RVCE_CS(0x00000000); // encCropTopOffset
158 RVCE_CS((align(enc->base.height, 16) - enc->base.height) >> 1); // encCropBottomOffset
159 RVCE_CS(encNumMBsPerSlice); // encNumMBsPerSlice
160 RVCE_CS(0x00000000); // encIntraRefreshNumMBsPerSlot
161 RVCE_CS(0x00000000); // encForceIntraRefresh
162 RVCE_CS(0x00000000); // encForceIMBPeriod
163 RVCE_CS(0x00000000); // encPicOrderCntType
164 RVCE_CS(0x00000000); // log2_max_pic_order_cnt_lsb_minus4
165 RVCE_CS(0x00000000); // encSPSID
166 RVCE_CS(0x00000000); // encPPSID
167 RVCE_CS(0x00000040); // encConstraintSetFlags
168 RVCE_CS(MAX2(enc->base.max_references, 1) - 1); // encBPicPattern
169 RVCE_CS(0x00000000); // weightPredModeBPicture
170 RVCE_CS(MIN2(enc->base.max_references, 2)); // encNumberOfReferenceFrames
171 RVCE_CS(enc->base.max_references + 1); // encMaxNumRefFrames
172 RVCE_CS(0x00000001); // encNumDefaultActiveRefL0
173 RVCE_CS(0x00000001); // encNumDefaultActiveRefL1
174 RVCE_CS(0x00000000); // encSliceMode
175 RVCE_CS(0x00000000); // encMaxSliceSize
176 RVCE_END();
177 }
178
179 static void motion_estimation(struct rvce_encoder *enc)
180 {
181 RVCE_BEGIN(0x04000007); // motion estimation
182 RVCE_CS(0x00000001); // encIMEDecimationSearch
183 RVCE_CS(0x00000001); // motionEstHalfPixel
184 RVCE_CS(0x00000000); // motionEstQuarterPixel
185 RVCE_CS(0x00000000); // disableFavorPMVPoint
186 RVCE_CS(0x00000000); // forceZeroPointCenter
187 RVCE_CS(0x00000000); // LSMVert
188 RVCE_CS(0x00000010); // encSearchRangeX
189 RVCE_CS(0x00000010); // encSearchRangeY
190 RVCE_CS(0x00000010); // encSearch1RangeX
191 RVCE_CS(0x00000010); // encSearch1RangeY
192 RVCE_CS(0x00000000); // disable16x16Frame1
193 RVCE_CS(0x00000000); // disableSATD
194 RVCE_CS(0x00000000); // enableAMD
195 RVCE_CS(0x000000fe); // encDisableSubMode
196 RVCE_CS(0x00000000); // encIMESkipX
197 RVCE_CS(0x00000000); // encIMESkipY
198 RVCE_CS(0x00000000); // encEnImeOverwDisSubm
199 RVCE_CS(0x00000000); // encImeOverwDisSubmNo
200 RVCE_CS(0x00000001); // encIME2SearchRangeX
201 RVCE_CS(0x00000001); // encIME2SearchRangeY
202 RVCE_CS(0x00000000); // parallelModeSpeedupEnable
203 RVCE_CS(0x00000000); // fme0_encDisableSubMode
204 RVCE_CS(0x00000000); // fme1_encDisableSubMode
205 RVCE_CS(0x00000000); // imeSWSpeedupEnable
206 RVCE_END();
207 }
208
209 static void rdo(struct rvce_encoder *enc)
210 {
211 RVCE_BEGIN(0x04000008); // rdo
212 RVCE_CS(0x00000000); // encDisableTbePredIFrame
213 RVCE_CS(0x00000000); // encDisableTbePredPFrame
214 RVCE_CS(0x00000000); // useFmeInterpolY
215 RVCE_CS(0x00000000); // useFmeInterpolUV
216 RVCE_CS(0x00000000); // useFmeIntrapolY
217 RVCE_CS(0x00000000); // useFmeIntrapolUV
218 RVCE_CS(0x00000000); // useFmeInterpolY_1
219 RVCE_CS(0x00000000); // useFmeInterpolUV_1
220 RVCE_CS(0x00000000); // useFmeIntrapolY_1
221 RVCE_CS(0x00000000); // useFmeIntrapolUV_1
222 RVCE_CS(0x00000000); // enc16x16CostAdj
223 RVCE_CS(0x00000000); // encSkipCostAdj
224 RVCE_CS(0x00000000); // encForce16x16skip
225 RVCE_CS(0x00000000); // encDisableThresholdCalcA
226 RVCE_CS(0x00000000); // encLumaCoeffCost
227 RVCE_CS(0x00000000); // encLumaMBCoeffCost
228 RVCE_CS(0x00000000); // encChromaCoeffCost
229 RVCE_END();
230 }
231
232 static void vui(struct rvce_encoder *enc)
233 {
234 int i;
235
236 RVCE_BEGIN(0x04000009); // vui
237 RVCE_CS(0x00000000); //aspectRatioInfoPresentFlag
238 RVCE_CS(0x00000000); //aspectRatioInfo.aspectRatioIdc
239 RVCE_CS(0x00000000); //aspectRatioInfo.sarWidth
240 RVCE_CS(0x00000000); //aspectRatioInfo.sarHeight
241 RVCE_CS(0x00000000); //overscanInfoPresentFlag
242 RVCE_CS(0x00000000); //overScanInfo.overscanAppropFlag
243 RVCE_CS(0x00000000); //videoSignalTypePresentFlag
244 RVCE_CS(0x00000005); //videoSignalTypeInfo.videoFormat
245 RVCE_CS(0x00000000); //videoSignalTypeInfo.videoFullRangeFlag
246 RVCE_CS(0x00000000); //videoSignalTypeInfo.colorDescriptionPresentFlag
247 RVCE_CS(0x00000002); //videoSignalTypeInfo.colorPrim
248 RVCE_CS(0x00000002); //videoSignalTypeInfo.transferChar
249 RVCE_CS(0x00000002); //videoSignalTypeInfo.matrixCoef
250 RVCE_CS(0x00000000); //chromaLocInfoPresentFlag
251 RVCE_CS(0x00000000); //chromaLocInfo.chromaLocTop
252 RVCE_CS(0x00000000); //chromaLocInfo.chromaLocBottom
253 RVCE_CS(0x00000001); //timingInfoPresentFlag
254 RVCE_CS(enc->pic.rate_ctrl.frame_rate_den); //timingInfo.numUnitsInTick
255 RVCE_CS(enc->pic.rate_ctrl.frame_rate_num * 2); //timingInfo.timeScale;
256 RVCE_CS(0x00000001); //timingInfo.fixedFrameRateFlag
257 RVCE_CS(0x00000000); //nalHRDParametersPresentFlag
258 RVCE_CS(0x00000000); //hrdParam.cpbCntMinus1
259 RVCE_CS(0x00000004); //hrdParam.bitRateScale
260 RVCE_CS(0x00000006); //hrdParam.cpbSizeScale
261 for (i = 0; i < 32; i++) {
262 RVCE_CS(0x00000000); //hrdParam.bitRateValueMinus
263 RVCE_CS(0x00000000); //hrdParam.cpbSizeValueMinus
264 RVCE_CS(0x00000000); //hrdParam.cbrFlag
265 }
266 RVCE_CS(0x00000017); //hrdParam.initialCpbRemovalDelayLengthMinus1
267 RVCE_CS(0x00000017); //hrdParam.cpbRemovalDelayLengthMinus1
268 RVCE_CS(0x00000017); //hrdParam.dpbOutputDelayLengthMinus1
269 RVCE_CS(0x00000018); //hrdParam.timeOffsetLength
270 RVCE_CS(0x00000000); //lowDelayHRDFlag
271 RVCE_CS(0x00000000); //picStructPresentFlag
272 RVCE_CS(0x00000000); //bitstreamRestrictionPresentFlag
273 RVCE_CS(0x00000001); //bitstreamRestrictions.motionVectorsOverPicBoundariesFlag
274 RVCE_CS(0x00000002); //bitstreamRestrictions.maxBytesPerPicDenom
275 RVCE_CS(0x00000001); //bitstreamRestrictions.maxBitsPerMbDenom
276 RVCE_CS(0x00000010); //bitstreamRestrictions.log2MaxMvLengthHori
277 RVCE_CS(0x00000010); //bitstreamRestrictions.log2MaxMvLengthVert
278 RVCE_CS(0x00000003); //bitstreamRestrictions.numReorderFrames
279 RVCE_CS(0x00000003); //bitstreamRestrictions.maxDecFrameBuffering
280 RVCE_END();
281 }
282
283 static void config(struct rvce_encoder *enc)
284 {
285 enc->task_info(enc, 0x00000002, 0, 0xffffffff, 0);
286 enc->rate_control(enc);
287 enc->config_extension(enc);
288 enc->motion_estimation(enc);
289 enc->rdo(enc);
290 if (enc->use_vui)
291 enc->vui(enc);
292 enc->pic_control(enc);
293 }
294
295 static void encode(struct rvce_encoder *enc)
296 {
297 signed luma_offset, chroma_offset;
298 int i;
299
300 enc->task_info(enc, 0x00000003, 0, 0, 0);
301
302 RVCE_BEGIN(0x05000001); // context buffer
303 RVCE_READWRITE(enc->cpb.res->cs_buf, enc->cpb.res->domains, 0x0); // encodeContextAddressHi/Lo
304 RVCE_END();
305
306 RVCE_BEGIN(0x05000004); // video bitstream buffer
307 RVCE_WRITE(enc->bs_handle, RADEON_DOMAIN_GTT, 0x0); // videoBitstreamRingAddressHi/Lo
308 RVCE_CS(enc->bs_size); // videoBitstreamRingSize
309 RVCE_END();
310
311 RVCE_BEGIN(0x03000001); // encode
312 RVCE_CS(0x00000000); // insertHeaders
313 RVCE_CS(0x00000000); // pictureStructure
314 RVCE_CS(enc->bs_size); // allowedMaxBitstreamSize
315 RVCE_CS(0x00000000); // forceRefreshMap
316 RVCE_CS(0x00000000); // insertAUD
317 RVCE_CS(0x00000000); // endOfSequence
318 RVCE_CS(0x00000000); // endOfStream
319 RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
320 enc->luma->level[0].offset); // inputPictureLumaAddressHi/Lo
321 RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
322 enc->chroma->level[0].offset); // inputPictureChromaAddressHi/Lo
323 RVCE_CS(align(enc->luma->npix_y, 16)); // encInputFrameYPitch
324 RVCE_CS(enc->luma->level[0].pitch_bytes); // encInputPicLumaPitch
325 RVCE_CS(enc->chroma->level[0].pitch_bytes); // encInputPicChromaPitch
326 RVCE_CS(0x00000000); // encInputPic(Addr|Array)Mode
327 RVCE_CS(0x00000000); // encInputPicTileConfig
328 RVCE_CS(enc->pic.picture_type); // encPicType
329 RVCE_CS(enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_IDR); // encIdrFlag
330 RVCE_CS(0x00000000); // encIdrPicId
331 RVCE_CS(0x00000000); // encMGSKeyPic
332 RVCE_CS(!enc->pic.not_referenced); // encReferenceFlag
333 RVCE_CS(0x00000000); // encTemporalLayerIndex
334 RVCE_CS(0x00000000); // num_ref_idx_active_override_flag
335 RVCE_CS(0x00000000); // num_ref_idx_l0_active_minus1
336 RVCE_CS(0x00000000); // num_ref_idx_l1_active_minus1
337
338 i = enc->pic.frame_num - enc->pic.ref_idx_l0;
339 if (i > 1 && enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_P) {
340 RVCE_CS(0x00000001); // encRefListModificationOp
341 RVCE_CS(i - 1); // encRefListModificationNum
342 } else {
343 RVCE_CS(0x00000000); // encRefListModificationOp
344 RVCE_CS(0x00000000); // encRefListModificationNum
345 }
346
347 for (i = 0; i < 3; ++i) {
348 RVCE_CS(0x00000000); // encRefListModificationOp
349 RVCE_CS(0x00000000); // encRefListModificationNum
350 }
351 for (i = 0; i < 4; ++i) {
352 RVCE_CS(0x00000000); // encDecodedPictureMarkingOp
353 RVCE_CS(0x00000000); // encDecodedPictureMarkingNum
354 RVCE_CS(0x00000000); // encDecodedPictureMarkingIdx
355 RVCE_CS(0x00000000); // encDecodedRefBasePictureMarkingOp
356 RVCE_CS(0x00000000); // encDecodedRefBasePictureMarkingNum
357 }
358
359 // encReferencePictureL0[0]
360 RVCE_CS(0x00000000); // pictureStructure
361 if(enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_P ||
362 enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_B) {
363 struct rvce_cpb_slot *l0 = l0_slot(enc);
364 rvce_frame_offset(enc, l0, &luma_offset, &chroma_offset);
365 RVCE_CS(l0->picture_type); // encPicType
366 RVCE_CS(l0->frame_num); // frameNumber
367 RVCE_CS(l0->pic_order_cnt); // pictureOrderCount
368 RVCE_CS(luma_offset); // lumaOffset
369 RVCE_CS(chroma_offset); // chromaOffset
370 } else {
371 RVCE_CS(0x00000000); // encPicType
372 RVCE_CS(0x00000000); // frameNumber
373 RVCE_CS(0x00000000); // pictureOrderCount
374 RVCE_CS(0xffffffff); // lumaOffset
375 RVCE_CS(0xffffffff); // chromaOffset
376 }
377
378 // encReferencePictureL0[1]
379 RVCE_CS(0x00000000); // pictureStructure
380 RVCE_CS(0x00000000); // encPicType
381 RVCE_CS(0x00000000); // frameNumber
382 RVCE_CS(0x00000000); // pictureOrderCount
383 RVCE_CS(0xffffffff); // lumaOffset
384 RVCE_CS(0xffffffff); // chromaOffset
385
386 // encReferencePictureL1[0]
387 RVCE_CS(0x00000000); // pictureStructure
388 if(enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_B) {
389 struct rvce_cpb_slot *l1 = l1_slot(enc);
390 rvce_frame_offset(enc, l1, &luma_offset, &chroma_offset);
391 RVCE_CS(l1->picture_type); // encPicType
392 RVCE_CS(l1->frame_num); // frameNumber
393 RVCE_CS(l1->pic_order_cnt); // pictureOrderCount
394 RVCE_CS(luma_offset); // lumaOffset
395 RVCE_CS(chroma_offset); // chromaOffset
396 } else {
397 RVCE_CS(0x00000000); // encPicType
398 RVCE_CS(0x00000000); // frameNumber
399 RVCE_CS(0x00000000); // pictureOrderCount
400 RVCE_CS(0xffffffff); // lumaOffset
401 RVCE_CS(0xffffffff); // chromaOffset
402 }
403
404 rvce_frame_offset(enc, current_slot(enc), &luma_offset, &chroma_offset);
405 RVCE_CS(luma_offset); // encReconstructedLumaOffset
406 RVCE_CS(chroma_offset); // encReconstructedChromaOffset
407 RVCE_CS(0x00000000); // encColocBufferOffset
408 RVCE_CS(0x00000000); // encReconstructedRefBasePictureLumaOffset
409 RVCE_CS(0x00000000); // encReconstructedRefBasePictureChromaOffset
410 RVCE_CS(0x00000000); // encReferenceRefBasePictureLumaOffset
411 RVCE_CS(0x00000000); // encReferenceRefBasePictureChromaOffset
412 RVCE_CS(0x00000000); // pictureCount
413 RVCE_CS(enc->pic.frame_num); // frameNumber
414 RVCE_CS(enc->pic.pic_order_cnt); // pictureOrderCount
415 RVCE_CS(0x00000000); // numIPicRemainInRCGOP
416 RVCE_CS(0x00000000); // numPPicRemainInRCGOP
417 RVCE_CS(0x00000000); // numBPicRemainInRCGOP
418 RVCE_CS(0x00000000); // numIRPicRemainInRCGOP
419 RVCE_CS(0x00000000); // enableIntraRefresh
420 RVCE_END();
421 }
422
423 static void destroy(struct rvce_encoder *enc)
424 {
425 enc->task_info(enc, 0x00000001, 0, 0, 0);
426
427 RVCE_BEGIN(0x02000001); // destroy
428 RVCE_END();
429 }
430
431 void radeon_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 }