17ec681f3Smrg/**************************************************************************
27ec681f3Smrg *
37ec681f3Smrg * Copyright 2014 Advanced Micro Devices, Inc.
47ec681f3Smrg * All Rights Reserved.
57ec681f3Smrg *
67ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a
77ec681f3Smrg * copy of this software and associated documentation files (the
87ec681f3Smrg * "Software"), to deal in the Software without restriction, including
97ec681f3Smrg * without limitation the rights to use, copy, modify, merge, publish,
107ec681f3Smrg * distribute, sub license, and/or sell copies of the Software, and to
117ec681f3Smrg * permit persons to whom the Software is furnished to do so, subject to
127ec681f3Smrg * the following conditions:
137ec681f3Smrg *
147ec681f3Smrg * The above copyright notice and this permission notice (including the
157ec681f3Smrg * next paragraph) shall be included in all copies or substantial portions
167ec681f3Smrg * of the Software.
177ec681f3Smrg *
187ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
197ec681f3Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
207ec681f3Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
217ec681f3Smrg * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
227ec681f3Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
237ec681f3Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
247ec681f3Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
257ec681f3Smrg *
267ec681f3Smrg **************************************************************************/
277ec681f3Smrg
287ec681f3Smrg#include "va_private.h"
297ec681f3Smrg
307ec681f3Smrgvoid vlVaHandlePictureParameterBufferVC1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)
317ec681f3Smrg{
327ec681f3Smrg   VAPictureParameterBufferVC1 * vc1 = buf->data;
337ec681f3Smrg
347ec681f3Smrg   assert(buf->size >= sizeof(VAPictureParameterBufferVC1) && buf->num_elements == 1);
357ec681f3Smrg   context->desc.vc1.slice_count = 0;
367ec681f3Smrg   vlVaGetReferenceFrame(drv, vc1->forward_reference_picture, &context->desc.vc1.ref[0]);
377ec681f3Smrg   vlVaGetReferenceFrame(drv, vc1->backward_reference_picture, &context->desc.vc1.ref[1]);
387ec681f3Smrg   context->desc.vc1.picture_type = vc1->picture_fields.bits.picture_type;
397ec681f3Smrg   context->desc.vc1.frame_coding_mode = vc1->picture_fields.bits.frame_coding_mode;
407ec681f3Smrg   context->desc.vc1.postprocflag = vc1->post_processing != 0;
417ec681f3Smrg   context->desc.vc1.pulldown = vc1->sequence_fields.bits.pulldown;
427ec681f3Smrg   context->desc.vc1.interlace = vc1->sequence_fields.bits.interlace;
437ec681f3Smrg   context->desc.vc1.tfcntrflag = vc1->sequence_fields.bits.tfcntrflag;
447ec681f3Smrg   context->desc.vc1.finterpflag = vc1->sequence_fields.bits.finterpflag;
457ec681f3Smrg   context->desc.vc1.psf = vc1->sequence_fields.bits.psf;
467ec681f3Smrg   context->desc.vc1.dquant = vc1->pic_quantizer_fields.bits.dquant;
477ec681f3Smrg   context->desc.vc1.panscan_flag = vc1->entrypoint_fields.bits.panscan_flag;
487ec681f3Smrg   context->desc.vc1.refdist_flag =
497ec681f3Smrg      vc1->reference_fields.bits.reference_distance_flag;
507ec681f3Smrg   context->desc.vc1.quantizer = vc1->pic_quantizer_fields.bits.quantizer;
517ec681f3Smrg   context->desc.vc1.extended_mv = vc1->mv_fields.bits.extended_mv_flag;
527ec681f3Smrg   context->desc.vc1.extended_dmv = vc1->mv_fields.bits.extended_dmv_flag;
537ec681f3Smrg   context->desc.vc1.overlap = vc1->sequence_fields.bits.overlap;
547ec681f3Smrg   context->desc.vc1.vstransform =
557ec681f3Smrg      vc1->transform_fields.bits.variable_sized_transform_flag;
567ec681f3Smrg   context->desc.vc1.loopfilter = vc1->entrypoint_fields.bits.loopfilter;
577ec681f3Smrg   context->desc.vc1.fastuvmc = vc1->fast_uvmc_flag;
587ec681f3Smrg   context->desc.vc1.range_mapy_flag = vc1->range_mapping_fields.bits.luma_flag;
597ec681f3Smrg   context->desc.vc1.range_mapy = vc1->range_mapping_fields.bits.luma;
607ec681f3Smrg   context->desc.vc1.range_mapuv_flag = vc1->range_mapping_fields.bits.chroma_flag;
617ec681f3Smrg   context->desc.vc1.range_mapuv = vc1->range_mapping_fields.bits.chroma;
627ec681f3Smrg   context->desc.vc1.multires = vc1->sequence_fields.bits.multires;
637ec681f3Smrg   context->desc.vc1.syncmarker = vc1->sequence_fields.bits.syncmarker;
647ec681f3Smrg   context->desc.vc1.rangered = vc1->sequence_fields.bits.rangered;
657ec681f3Smrg   context->desc.vc1.maxbframes = vc1->sequence_fields.bits.max_b_frames;
667ec681f3Smrg   context->desc.vc1.deblockEnable = vc1->post_processing != 0;
677ec681f3Smrg   context->desc.vc1.pquant = vc1->pic_quantizer_fields.bits.pic_quantizer_scale;
687ec681f3Smrg}
697ec681f3Smrg
707ec681f3Smrgvoid vlVaHandleSliceParameterBufferVC1(vlVaContext *context, vlVaBuffer *buf)
717ec681f3Smrg{
727ec681f3Smrg   assert(buf->size >= sizeof(VASliceParameterBufferVC1) && buf->num_elements == 1);
737ec681f3Smrg   context->desc.vc1.slice_count += buf->num_elements;
747ec681f3Smrg}
75