Path: blob/21.2-virgl/src/gallium/frontends/va/picture_vc1.c
4561 views
/**************************************************************************1*2* Copyright 2014 Advanced Micro Devices, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#include "va_private.h"2829void vlVaHandlePictureParameterBufferVC1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)30{31VAPictureParameterBufferVC1 * vc1 = buf->data;3233assert(buf->size >= sizeof(VAPictureParameterBufferVC1) && buf->num_elements == 1);34context->desc.vc1.slice_count = 0;35vlVaGetReferenceFrame(drv, vc1->forward_reference_picture, &context->desc.vc1.ref[0]);36vlVaGetReferenceFrame(drv, vc1->backward_reference_picture, &context->desc.vc1.ref[1]);37context->desc.vc1.picture_type = vc1->picture_fields.bits.picture_type;38context->desc.vc1.frame_coding_mode = vc1->picture_fields.bits.frame_coding_mode;39context->desc.vc1.postprocflag = vc1->post_processing != 0;40context->desc.vc1.pulldown = vc1->sequence_fields.bits.pulldown;41context->desc.vc1.interlace = vc1->sequence_fields.bits.interlace;42context->desc.vc1.tfcntrflag = vc1->sequence_fields.bits.tfcntrflag;43context->desc.vc1.finterpflag = vc1->sequence_fields.bits.finterpflag;44context->desc.vc1.psf = vc1->sequence_fields.bits.psf;45context->desc.vc1.dquant = vc1->pic_quantizer_fields.bits.dquant;46context->desc.vc1.panscan_flag = vc1->entrypoint_fields.bits.panscan_flag;47context->desc.vc1.refdist_flag =48vc1->reference_fields.bits.reference_distance_flag;49context->desc.vc1.quantizer = vc1->pic_quantizer_fields.bits.quantizer;50context->desc.vc1.extended_mv = vc1->mv_fields.bits.extended_mv_flag;51context->desc.vc1.extended_dmv = vc1->mv_fields.bits.extended_dmv_flag;52context->desc.vc1.overlap = vc1->sequence_fields.bits.overlap;53context->desc.vc1.vstransform =54vc1->transform_fields.bits.variable_sized_transform_flag;55context->desc.vc1.loopfilter = vc1->entrypoint_fields.bits.loopfilter;56context->desc.vc1.fastuvmc = vc1->fast_uvmc_flag;57context->desc.vc1.range_mapy_flag = vc1->range_mapping_fields.bits.luma_flag;58context->desc.vc1.range_mapy = vc1->range_mapping_fields.bits.luma;59context->desc.vc1.range_mapuv_flag = vc1->range_mapping_fields.bits.chroma_flag;60context->desc.vc1.range_mapuv = vc1->range_mapping_fields.bits.chroma;61context->desc.vc1.multires = vc1->sequence_fields.bits.multires;62context->desc.vc1.syncmarker = vc1->sequence_fields.bits.syncmarker;63context->desc.vc1.rangered = vc1->sequence_fields.bits.rangered;64context->desc.vc1.maxbframes = vc1->sequence_fields.bits.max_b_frames;65context->desc.vc1.deblockEnable = vc1->post_processing != 0;66context->desc.vc1.pquant = vc1->pic_quantizer_fields.bits.pic_quantizer_scale;67}6869void vlVaHandleSliceParameterBufferVC1(vlVaContext *context, vlVaBuffer *buf)70{71assert(buf->size >= sizeof(VASliceParameterBufferVC1) && buf->num_elements == 1);72context->desc.vc1.slice_count += buf->num_elements;73}747576