Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp

Issue 1800523005: Move core/src/ up to core/. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h ('k') | core/src/fxcodec/jbig2/JBig2_HuffmanTable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
deleted file mode 100644
index 093d2abadb75f9746e96996b636540a89fa65c33..0000000000000000000000000000000000000000
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h"
-
-#include "core/src/fxcodec/jbig2/JBig2_Define.h"
-
-CJBig2_HuffmanDecoder::CJBig2_HuffmanDecoder(CJBig2_BitStream* pStream)
- : m_pStream(pStream) {
-}
-
-CJBig2_HuffmanDecoder::~CJBig2_HuffmanDecoder() {}
-
-int CJBig2_HuffmanDecoder::decodeAValue(CJBig2_HuffmanTable* pTable,
- int* nResult) {
- int nVal = 0;
- int nBits = 0;
- while (1) {
- FX_DWORD nTmp;
- if (m_pStream->read1Bit(&nTmp) == -1)
- break;
-
- nVal = (nVal << 1) | nTmp;
- ++nBits;
- for (FX_DWORD i = 0; i < pTable->Size(); ++i) {
- if (pTable->GetPREFLEN()[i] == nBits && pTable->GetCODES()[i] == nVal) {
- if (pTable->IsHTOOB() && i == pTable->Size() - 1)
- return JBIG2_OOB;
-
- if (m_pStream->readNBits(pTable->GetRANGELEN()[i], &nTmp) == -1)
- return -1;
-
- FX_DWORD offset = pTable->IsHTOOB() ? 3 : 2;
- if (i == pTable->Size() - offset)
- *nResult = pTable->GetRANGELOW()[i] - nTmp;
- else
- *nResult = pTable->GetRANGELOW()[i] + nTmp;
- return 0;
- }
- }
- }
- return -1;
-}
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h ('k') | core/src/fxcodec/jbig2/JBig2_HuffmanTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698