Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
Fixed warnings "Wmissing-braces"
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Losev <[email protected]>
  • Loading branch information
ivan-losev authored and Oleg Nabiullin committed May 8, 2018
1 parent bf80f32 commit 6941f03
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion _studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,7 @@ namespace
mfxU32 fid)
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "CountLeadingFF");
mfxFrameData bitstream = { 0 };
mfxFrameData bitstream = {};

task.m_numLeadingFF[fid] = 0;
FrameLocker lock(&core, bitstream, task.m_midBit[fid]);
Expand Down
20 changes: 10 additions & 10 deletions _studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw_utils.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2018 Intel Corporation
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -1424,7 +1424,7 @@ mfxU8 LookAheadBrc2::GetQp(const BRCFrameParams& par)
brcprintf("\r%4d: do=%4d type=%c Rt=%7.3f-%7.3f curc=%4d numc=%2d ", m_laData[0].encOrder, m_laData[0].poc/2,
GetFrameTypeLetter(par.FrameType), m_targetRateMin, m_targetRateMax, m_laData[0].interCost / m_totNumMb, mfxU32(m_laData.size()));


mfxF64 totalEstRate[52] = { 0.0 };

for (mfxU32 qp = 0; qp < 52; qp++)
Expand Down Expand Up @@ -1598,7 +1598,7 @@ mfxU32 LookAheadBrc2::Report(const BRCFrameParams& par , mfxU32 dataLength, mfxU

if (m_AvgBitrate)
m_AvgBitrate->UpdateSlidingWindow(8 * dataLength, par.EncodedOrder, m_skipped>0, (par.FrameType & MFX_FRAMETYPE_I)!=0, par.NumRecode, qp);

m_framesBehind++;
m_bitsBehind += realRatePerMb;
mfxF64 framesBeyond = (mfxF64)(MFX_MAX(2, m_laData.size()) - 1 - m_first);
Expand Down Expand Up @@ -3085,7 +3085,7 @@ void MfxHwH264Encode::FastCopyBufferSys2Vid(void * dstVid, void const * srcSys,
assert(sts == MFX_ERR_NONE); sts;



}

void CyclicTaskPool::Init(mfxU32 size)
Expand Down Expand Up @@ -3957,7 +3957,7 @@ mfxStatus MfxHwH264Encode::CopyBitstream(VideoCORE & core,
mfxU8 * bsData,
mfxU32 bsSizeAvail)
{
mfxFrameData bitstream = { 0 };
mfxFrameData bitstream = {};

FrameLocker lock(&core, bitstream, task.m_midBit[fieldId]);
MFX_CHECK(video.Protected == 0 || task.m_notProtected, MFX_ERR_UNDEFINED_BEHAVIOR);
Expand Down Expand Up @@ -4327,7 +4327,7 @@ mfxStatus MfxHwH264Encode::CorrectSliceInfo(DdiTask & task, mfxU32 MaxSliceWei
{
if (task.m_SliceInfo.size() == 0) return MFX_ERR_NONE;

SliceStructInfo new_info[256] = {0};
SliceStructInfo new_info[256] = {};
mfxU32 new_slice = 0;
mfxU32 curMB = 0;
mfxU32 old_slice = 0;
Expand Down Expand Up @@ -4387,9 +4387,9 @@ mfxStatus MfxHwH264Encode::CorrectSliceInfoForsed(DdiTask & task, mfxU32 widthLa
if (!freeSlisesMax)
return MFX_ERR_NONE;

mfxU32 bigSlices[256] ={0};
mfxU32 bigSlices[256] = {};
mfxU32 numBigSlices = 0;
SliceStructInfo new_info[256] = {0};
SliceStructInfo new_info[256] = {};

mfxU32 widthMB = task.m_yuv->Info.Width/16;
mfxU32 heightMB = task.m_yuv->Info.Height/16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2452,13 +2452,13 @@ mfxStatus MfxHwH264Encode::CodeAsSkipFrame( VideoCORE & core,
sts = core.GetFrameHDL(task.m_midRaw, &task.m_handleRaw.first);
MFX_CHECK_STS(sts);
}


if (task.GetFrameType() & MFX_FRAMETYPE_I)
{
mfxFrameData curr = { 0 };
mfxFrameData curr = {};
curr.MemId = task.m_midRaw;
FrameLocker lock1(&core, curr, task.m_midRaw);
FrameLocker lock1(&core, curr, task.m_midRaw);
mfxU32 size = curr.Pitch*video.mfx.FrameInfo.Height;
memset(curr.Y, 0, size);

Expand All @@ -2478,8 +2478,8 @@ mfxStatus MfxHwH264Encode::CodeAsSkipFrame( VideoCORE & core,
if (task.GetFrameType() & MFX_FRAMETYPE_P)
{
DpbFrame& refFrame = task.m_dpb[0][task.m_list0[0][0] & 127];
mfxFrameData curr = { 0 };
mfxFrameData ref = { 0 };
mfxFrameData curr = {};
mfxFrameData ref = {};
curr.MemId = task.m_midRaw;
ref.MemId = refFrame.m_midRec;

Expand All @@ -2491,7 +2491,7 @@ mfxStatus MfxHwH264Encode::CodeAsSkipFrame( VideoCORE & core,
if (task.GetFrameType() & MFX_FRAMETYPE_B)
{
task.m_ctrl.SkipFrame = 1;
}
}

return sts;
}
Expand Down
18 changes: 9 additions & 9 deletions _studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2017 Intel Corporation
//
// Copyright (c) 2017-2018 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -1078,7 +1078,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::TaskRoutineSubmitFrame(
// WA for RGB swapping issue
if (enc.m_vParam.mfx.FrameInfo.FourCC == MFX_FOURCC_RGB4)
{
mfxFrameData dstSurf = { 0 };
mfxFrameData dstSurf = {};
bool bExternalFrameLocked = false;

if(enc.m_pCore->GetVAType() == MFX_HW_VAAPI )
Expand All @@ -1091,8 +1091,8 @@ mfxStatus MFXVideoENCODEMJPEG_HW::TaskRoutineSubmitFrame(
bExternalFrameLocked = true;
}
MFX_CHECK(nativeSurf->Data.B != 0, MFX_ERR_LOCK_MEMORY);


const int dstOrder[3] = {2, 1, 0};
mfxSize roi = {nativeSurf->Info.Width, nativeSurf->Info.Height};
mfxSize setroi = {nativeSurf->Info.Width*4, nativeSurf->Info.Height};
Expand All @@ -1107,7 +1107,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::TaskRoutineSubmitFrame(
dstSurf.R, dstPitch,
roi, dstOrder);
MFX_CHECK(res, MFX_ERR_UNDEFINED_BEHAVIOR);

if (bExternalFrameLocked)
{
sts = enc.m_pCore->UnlockExternalFrame(nativeSurf->Data.MemId, &nativeSurf->Data);
Expand All @@ -1126,7 +1126,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::TaskRoutineSubmitFrame(
dst.Data = dstSurf;
src_memtype = (mfxU16)((nativeSurf->Data.B == 0)?MFX_MEMTYPE_DXVA2_DECODER_TARGET:MFX_MEMTYPE_SYSTEM_MEMORY);
src_memtype |= enc.m_isOpaqIn? MFX_MEMTYPE_INTERNAL_FRAME: MFX_MEMTYPE_EXTERNAL_FRAME;
sts = enc.m_pCore->DoFastCopyWrapper(&dst,MFX_MEMTYPE_DXVA2_DECODER_TARGET|MFX_MEMTYPE_INTERNAL_FRAME,nativeSurf,
sts = enc.m_pCore->DoFastCopyWrapper(&dst,MFX_MEMTYPE_DXVA2_DECODER_TARGET|MFX_MEMTYPE_INTERNAL_FRAME,nativeSurf,
src_memtype);
MFX_CHECK_STS(sts);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2017 Intel Corporation
//
// Copyright (c) 2017-2018 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -150,7 +150,7 @@ mfxStatus MfxHwMJpegEncode::FastCopyFrameBufferSys2Vid(
)
{
MFX_CHECK_NULL_PTR1(core);
mfxFrameData vidSurf = { 0 };
mfxFrameData vidSurf = {};
mfxStatus sts = MFX_ERR_NONE;
vidSurf.MemId = vidMemId;

Expand Down Expand Up @@ -203,7 +203,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
m_app14_data.flags1H = 0;
m_app14_data.flags1L = 0;
m_app14_data.transform = 0; //RGB

mfxU32 payloadSize = 16;
if (m_payload_base.length + payloadSize > m_payload_base.maxLength)
{
Expand Down
22 changes: 11 additions & 11 deletions _studio/shared/asc/include/asc_common_impl.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2018 Intel Corporation
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -33,14 +33,14 @@ ASC_ALIGN_DECL(16) static const mfxU16 tab_twostep[8] = {
};

ASC_ALIGN_DECL(16) static const mfxU16 tab_killmask[8][8] = {
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff,
{ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff },
};

#define _mm_loadh_epi64(a, ptr) _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(a), (__m64 *)(ptr)))
Expand Down
28 changes: 14 additions & 14 deletions _studio/shared/asc/src/motion_estimation_engine.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) 2018 Intel Corporation
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -90,7 +90,7 @@ bool MVcalcSAD8x8(ASCMVector MV, pmfxU8 curY, pmfxU8 refY, ASCImDetails *dataIn,
preDist = (MV.x * MV.x) + (MV.y * MV.y),
_fPos = MV.x + (MV.y * dataIn->Extended_Width);
pmfxU8
fRef = &refY[_fPos];
fRef = &refY[_fPos];
mfxU16
SAD = ME_SAD_8x8_Block(curY, fRef, dataIn->Extended_Width, dataIn->Extended_Width);
if((SAD < *bestSAD) || ((SAD == *(bestSAD)) && *distance > preDist)) {
Expand All @@ -105,7 +105,7 @@ bool MVcalcSAD16x8(ASCMVector MV, pmfxU8 curY, pmfxU8 refY, ASCImDetails dataIn,
mfxI32
preDist = (MV.x * MV.x) + (MV.y * MV.y);
pmfxU8
fRef = refY + MV.x + (MV.y * dataIn.Extended_Width);
fRef = refY + MV.x + (MV.y * dataIn.Extended_Width);
mfxU16
SAD = ME_SAD_16x8_Block(curY, fRef, dataIn.Extended_Width, dataIn.Extended_Width);
if((SAD < *bestSAD) || ((SAD == *(bestSAD)) && *distance > preDist)) {
Expand Down Expand Up @@ -221,14 +221,14 @@ alignas(16) static const mfxU16 tab_twostep[8] = {
};

alignas(16) static const mfxU16 tab_killmask[8][8] = {
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff,
{ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff },
};

mfxU16 __cdecl ME_simple(ASCVidRead *videoIn, mfxI32 fPos, ASCImDetails *dataIn, ASCimageData *scale, ASCimageData *scaleRef, bool first, ASCVidData *limits, t_ME_SAD_8x8_Block_Search ME_SAD_8x8_Block_Search) {
Expand Down Expand Up @@ -317,7 +317,7 @@ mfxU16 __cdecl ME_simple(ASCVidRead *videoIn, mfxI32 fPos, ASCImDetails *dataIn,
}
}
}

//Search around the best predictor (zero or Neighbor)
SearchLimitsCalcSqr(xLoc, yLoc, &limitXleft, &limitXright, &limitYup, &limitYdown, dataIn, 8, current[fPos], limits);//Checks limits for +-8
ttMV = current[fPos];
Expand Down

0 comments on commit 6941f03

Please sign in to comment.