nikon NEF decoder: ~20% speedup, #4751
This commit is contained in:
@@ -60,6 +60,7 @@ public:
|
||||
,RT_matrix_from_constant(0)
|
||||
,RT_from_adobe_dng_converter(false)
|
||||
,getbithuff(this,ifp,zero_after_ff)
|
||||
,nikbithuff(this,ifp)
|
||||
{
|
||||
memset(&hbd, 0, sizeof(hbd));
|
||||
aber[0]=aber[1]=aber[2]=aber[3]=1;
|
||||
@@ -214,6 +215,7 @@ protected:
|
||||
int fcol (int row, int col);
|
||||
void merror (void *ptr, const char *where);
|
||||
void derror();
|
||||
void derror(bool condition) {data_error += condition;}
|
||||
ushort sget2 (uchar *s);
|
||||
ushort get2();
|
||||
unsigned sget4 (uchar *s);
|
||||
@@ -252,6 +254,25 @@ private:
|
||||
};
|
||||
getbithuff_t getbithuff;
|
||||
|
||||
class nikbithuff_t
|
||||
{
|
||||
public:
|
||||
nikbithuff_t(DCraw *p,IMFILE *&i):parent(p),bitbuf(0),errors(0),vbits(0),ifp(i){}
|
||||
void operator()() {bitbuf = vbits = 0;};
|
||||
unsigned operator()(int nbits, ushort *huff);
|
||||
unsigned errorCount() { return errors; }
|
||||
private:
|
||||
bool derror(bool condition){
|
||||
errors += condition;
|
||||
return condition;
|
||||
}
|
||||
DCraw *parent;
|
||||
unsigned bitbuf, errors;
|
||||
int vbits;
|
||||
IMFILE *&ifp;
|
||||
};
|
||||
nikbithuff_t nikbithuff;
|
||||
|
||||
ushort * make_decoder_ref (const uchar **source);
|
||||
ushort * make_decoder (const uchar *source);
|
||||
void crw_init_tables (unsigned table, ushort *huff[2]);
|
||||
|
Reference in New Issue
Block a user