1 // BcjCoder.cpp 2 3 #include "StdAfx.h" 4 5 #include "BcjCoder.h" 6 7 namespace NCompress { 8 namespace NBcj { 9 Init()10STDMETHODIMP CCoder::Init() 11 { 12 _bufferPos = 0; 13 x86_Convert_Init(_prevMask); 14 return S_OK; 15 } 16 STDMETHODIMP_(UInt32)17STDMETHODIMP_(UInt32) CCoder::Filter(Byte *data, UInt32 size) 18 { 19 UInt32 processed = (UInt32)::x86_Convert(data, size, _bufferPos, &_prevMask, _encode); 20 _bufferPos += processed; 21 return processed; 22 } 23 24 }} 25