Skip to content

Commit

Permalink
align cmd and hufftable
Browse files Browse the repository at this point in the history
  • Loading branch information
huangli2018 committed Jul 26, 2023
1 parent 9c2b4d3 commit d01a7c1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_mfx_g12_X.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,10 @@ MOS_STATUS MhwVdboxMfxInterfaceG12::AddMfxSurfaceCmd(
MOS_ALIGN_CEIL((params->psSurface->VPlaneOffset.iSurfaceOffset -params->psSurface->dwOffset)/params->psSurface->dwPitch + params->psSurface->RenderOffset.YUV.V.YOffset, uvPlaneAlignment);
}

//??for debug
cmd.DW3.SurfaceFormat = 0;
cmd.DW5.YOffsetForVCr = 192;

MHW_MI_CHK_STATUS(m_osInterface->pfnAddCommand(cmdBuffer, &cmd, sizeof(cmd)));

return eStatus;
Expand Down Expand Up @@ -1971,6 +1975,9 @@ MOS_STATUS MhwVdboxMfxInterfaceG12::AddMfxJpegPicCmd(
cmd.DW1.Obj1.VerticalUpSamplingEnable = 1;
}
}
//???for debug
cmd.DW1.Obj1.OutputFormatYuv = MHW_VDBOX_DECODE_JPEG_FORMAT_SEPARATE_PLANE;
cmd.DW1.Obj1.HorizontalDownSamplingEnable = 0;

cmd.DW2.Obj0.FrameWidthInBlocksMinus1 = params->dwWidthInBlocks;
cmd.DW2.Obj0.FrameHeightInBlocksMinus1 = params->dwHeightInBlocks;
Expand Down
14 changes: 13 additions & 1 deletion media_driver/linux/common/codec/ddi/media_ddi_decode_jpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,16 @@ VAStatus DdiDecodeJPEG::ParseHuffmanTbl(
//the size of jpegHuffTbl->HuffTable[i].DC_BITS is 12 (defined in driver)
//the size of huffmanTbl->huffman_table[i].num_dc_codes is 16 (defined in libva)
//it is using the size of "DC_BITS" for solve the overflow
MOS_SecureMemcpy(jpegHuffTbl->HuffTable[i].DC_BITS,

if(i == 1)
{
memset(jpegHuffTbl->HuffTable[i].DC_BITS,0,sizeof(jpegHuffTbl->HuffTable[i].DC_BITS));
memset(jpegHuffTbl->HuffTable[i].DC_HUFFVAL,0,sizeof(jpegHuffTbl->HuffTable[i].DC_HUFFVAL));
memset(jpegHuffTbl->HuffTable[i].AC_BITS,0,sizeof(jpegHuffTbl->HuffTable[i].AC_BITS));
memset(jpegHuffTbl->HuffTable[i].AC_HUFFVAL,0,sizeof(jpegHuffTbl->HuffTable[i].AC_HUFFVAL));
}
else{
MOS_SecureMemcpy(jpegHuffTbl->HuffTable[i].DC_BITS,
sizeof(jpegHuffTbl->HuffTable[i].DC_BITS),
huffmanTbl->huffman_table[i].num_dc_codes,
sizeof(jpegHuffTbl->HuffTable[i].DC_BITS));
Expand All @@ -282,6 +291,9 @@ VAStatus DdiDecodeJPEG::ParseHuffmanTbl(
sizeof(jpegHuffTbl->HuffTable[i].AC_HUFFVAL),
huffmanTbl->huffman_table[i].ac_values,
sizeof(huffmanTbl->huffman_table[i].ac_values));

}

}
}

Expand Down

0 comments on commit d01a7c1

Please sign in to comment.