Commit 93befd16 authored by Aolin Feng's avatar Aolin Feng
Browse files

fix padding problem

parent 2b10dd9e
......@@ -3,10 +3,10 @@
//set header and configs
Void Cfg::parseCfg()
{
m_uiPicWidth = 384;
m_uiPicHeight = 192;
m_sInputFileName = "G:/jpegimages/BasketballPass_384x192_50.gbr"; //picture name, png
m_sOutputFileName = "G:/jpegimages/BasketballPass_384x192_50_7.jpg"; //bitstream name, jpg
m_uiPicWidth = 5697;
m_uiPicHeight = 3742;
m_sInputFileName = "E:/Research/Project/RSP_JPEG/test_5697x3742.gbr"; //picture name, png
m_sOutputFileName = "E:/Research/Project/RSP_JPEG/Output/test_5697x3742.jpg"; //bitstream name, jpg
m_chromaFormat = CHROMA_420; //internal chroma format
m_dQp = 4;
m_dQp = 1;
}
\ No newline at end of file
......@@ -198,11 +198,11 @@ Void CodingUnit::huffmanAC()
for (UInt n = 0; n < uiNumPixelInCU; n++)
{
uiZigZagQuanCoeff[n] = *(uiQuanCoeff + g_uiZigZagTable[n]);
if (m_uiChannal == COMPONENT_Y && (row % 2) && (col % 2))
cout << uiQuanCoeff[n] << ' ';
//if (m_uiChannal == COMPONENT_Y && (row % 2) && (col % 2))
// cout << uiQuanCoeff[n] << ' ';
}
if (m_uiChannal == COMPONENT_Y && (row % 2) && (col % 2))
cout << endl;
//if (m_uiChannal == COMPONENT_Y && (row % 2) && (col % 2))
// cout << endl;
//derive EOB
while (uiZigZagQuanCoeff[uiPosEOB] == 0 && uiPosEOB > 1)
{
......
......@@ -82,8 +82,8 @@ Void CommonPic::init(Cfg cfg)
m_uiQpTable[1] = new UInt[64];
UInt uiEvenPicWidth = m_uiOrgPicWidth % 2 ? m_uiOrgPicWidth + 1 : m_uiOrgPicWidth;
UInt uiEvenPicHeight = m_uiOrgPicHeight % 2 ? m_uiOrgPicHeight + 1 : m_uiOrgPicHeight;
m_uiPicWidth = uiEvenPicWidth % CUSIZE ? (uiEvenPicWidth / CUSIZE + 1) * CUSIZE : uiEvenPicWidth;
m_uiPicHeight = uiEvenPicHeight % CUSIZE ? (uiEvenPicHeight / CUSIZE + 1) * CUSIZE : uiEvenPicHeight;
m_uiPicWidth = uiEvenPicWidth % (CUSIZE*2) ? (uiEvenPicWidth / (CUSIZE*2) + 1) * CUSIZE*2 : uiEvenPicWidth;
m_uiPicHeight = uiEvenPicHeight % (CUSIZE*2) ? (uiEvenPicHeight / (CUSIZE*2) + 1) * CUSIZE*2 : uiEvenPicHeight;
for (UInt iComp = 0; iComp < MAX_NUM_COMPONENT; iComp++)
{
......@@ -94,7 +94,7 @@ Void CommonPic::init(Cfg cfg)
m_uiPicDctCoeff[iComp] = new TCoeff[m_uiPicWidth * m_uiPicHeight / uiScale];
m_piPicQuanCoeff[iComp] = new TCoeff[m_uiPicWidth * m_uiPicHeight / uiScale];
memset(m_puiOrgPicRgb[iComp], 0, m_uiOrgPicWidth * uiEvenPicHeight);
memset(m_puiOrgPicRgb[iComp], 0, m_uiOrgPicWidth * m_uiOrgPicHeight);
memset(m_puiOrgPicYuv[iComp], 0, uiEvenPicWidth * uiEvenPicHeight);
memset(m_puiOrgPicBuf[iComp], 0, m_uiPicWidth * m_uiPicHeight / uiScale);
memset(m_uiPicDctCoeff[iComp], 0, m_uiPicWidth * m_uiPicHeight / uiScale);
......
......@@ -4,7 +4,7 @@
#define CUSIZE 8
#define DCLENGTH 12
#define ACLENGTH 256
#define MAXBYTENUM 10000000
#define MAXBYTENUM 100000000
#define DEBUG 0
typedef void Void;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment