コード例 #1
0
ファイル: symb.cpp プロジェクト: iley/intelib
static void compress_function(RfReference &ref)
{
    RfListItem *copy_start = 0;
    int bytes_left = 0;
    int value = 0;
    RfReference temp = new RfExpression;
    for (RfListItem *i = ref->GetFirst(); i; i = i->next) {
        if (!i->IsChar())
            throw IntelibX_refal_failure(ref);
	if ((i->charcode & 0xFFFFFF00) != 0)
	    continue;
	if ((i->charcode & 0x80) == 0) {
            if (i->prev != 0) {
                if (!copy_start) {
                    copy_start = i;
                }
            }
            else {
	        temp->QuickAdd(new RfListItem(i->charcode));
            }
	    continue;
	}
        if (copy_start) {
            CopyAll(temp, copy_start, i->prev);
            copy_start = 0;
        }
	if ((i->charcode & 0x40) == 0) {
	    if (bytes_left <= 0)
	        continue;
	    value <<= 8;
	    value += i->charcode;
	    bytes_left--;
	    if (bytes_left == 0) {
	        temp->QuickAdd(new RfListItem(value));
            }
	    continue;
	}
	if ((i->charcode & 0x20) == 0) {
	    value = i->charcode;
            bytes_left = 1;
            continue;
	}
	if ((i->charcode & 0x10) == 0) {
            value = i->charcode;
            bytes_left = 2;
            continue;
        }
        if ((i->charcode & 0x8) == 0) {
            value = i->charcode;
            bytes_left = 3;
            continue;
        }
    }
    if (copy_start) {
        CopyAll(temp, copy_start, ref->GetLast());
    }
    ref = temp;
}
コード例 #2
0
/**
 * The only process we are really guaranteed to have is this test process itself.
 * This test uses same one used in Process_Closer
 */
TEST(Process_List_Test, find_our_process_CI_generic)
{
  std::vector<PROCESSENTRY32W> v;
  initialize_process_list(v, process_by_name_CI(mixedcase_exe_name), CopyAll());
  size_t size(v.size());
  EXPECT_EQ(1u, size);      // Please, don't run multiple test executables simultaneously
  ASSERT_GE(1u, size);
}
コード例 #3
0
ファイル: symb.cpp プロジェクト: iley/intelib
static void decompress_function(RfReference &ref)
{
    RfListItem *copy_start = 0;
    RfReference res = new RfExpression;
    for (RfListItem *elem = ref->GetFirst(); elem; elem = elem->next) {
        if (!elem->IsChar())
	    throw IntelibX_refal_failure(ref);
        if ((elem->charcode & 0xFFFFFF00) == 0) {
            if (elem->prev != 0) {
                if (!copy_start) {
                    copy_start = elem;
                }
            }
            else {
                res->QuickAdd(new RfListItem(elem->charcode));
            }
            continue;
        }
        if (copy_start) {
            CopyAll(res, copy_start, elem->prev);
            copy_start = 0;
        }
        int c[4] = {0, 0, 0, 0};
        int temp = elem->charcode;
        for (int i = 3; i >= 0; i--) {
            c[i] = temp & 0xFF;
            if (c[i] == 0)
                break;
            temp >>= 8;
        }
        for (int i = 0; i < 4; i++) {
	    if (c[i]) {
                res->QuickAdd(new RfListItem(c[i]));
            }
        }
    }
    if (copy_start) {
        CopyAll(res, copy_start, ref->GetLast());
    }
    ref = res;
}
コード例 #4
0
ファイル: store.cpp プロジェクト: jeeb/MPGDec
void CMPEG2Decoder::assembleFrame(unsigned char *src[], int pf, YV12PICT *dst)
{
    int *qp;

#ifdef PROFILING
    start_timer();
#endif

    dst->pf = pf;

    if (pp_mode != 0)
    {
        uc* ppptr[3];
        if (!(upConv > 0 && chroma_format == 1))
        {
            ppptr[0] = dst->y;
            ppptr[1] = dst->u;
            ppptr[2] = dst->v;
        }
        else
        {
            ppptr[0] = dst->y;
            ppptr[1] = u422;
            ppptr[2] = v422;
        }
        bool iPPt;
        if (iPP == 1 || (iPP == -1 && pf == 0)) iPPt = true;
        else iPPt = false;
        postprocess(src, this->Coded_Picture_Width, this->Chroma_Width,
                ppptr, dst->ypitch, dst->uvpitch, this->Coded_Picture_Width,
                this->Coded_Picture_Height, this->QP, this->mb_width, pp_mode, moderate_h, moderate_v,
                chroma_format == 1 ? false : true, iPPt);
        if (upConv > 0 && chroma_format == 1)
        {
            if (iCC == 1 || (iCC == -1 && pf == 0))
            {
                conv420to422(ppptr[1],dst->u,0,dst->uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
                conv420to422(ppptr[2],dst->v,0,dst->uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
            }
            else
            {
                conv420to422(ppptr[1],dst->u,1,dst->uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
                conv420to422(ppptr[2],dst->v,1,dst->uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
            }
        }
    }
    else
    {
        YV12PICT psrc;
        psrc.y = src[0]; psrc.u = src[1]; psrc.v = src[2];
        psrc.ypitch = psrc.ywidth = Coded_Picture_Width;
        psrc.uvpitch = psrc.uvwidth = Chroma_Width;
        psrc.yheight = Coded_Picture_Height;
        psrc.uvheight = Chroma_Height;
        if (upConv > 0 && chroma_format == 1)
        {
            CopyPlane(psrc.y,psrc.ypitch,dst->y,dst->ypitch,psrc.ywidth,psrc.yheight);
            if (iCC == 1 || (iCC == -1 && pf == 0))
            {
                conv420to422(psrc.u,dst->u,0,psrc.uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
                conv420to422(psrc.v,dst->v,0,psrc.uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
            }
            else
            {
                conv420to422(psrc.u,dst->u,1,psrc.uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
                conv420to422(psrc.v,dst->v,1,psrc.uvpitch,dst->uvpitch,Coded_Picture_Width,Coded_Picture_Height);
            }
        }
        else CopyAll(&psrc,dst);
    }

    // Re-order quant data for display order.
    if (info == 1 || info == 2 || showQ)
    {
        if (picture_coding_type == B_TYPE)
            qp = auxQP;
        else
            qp = backwardQP;
    }

    if (info == 1 || info == 2)
    {
        __asm emms;
        int x, y, temp;
        int quant;

        minquant = maxquant = qp[0];
        avgquant = 0;
        for(y=0; y<mb_height; ++y)
        {
            temp = y*mb_width;
            for(x=0; x<mb_width; ++x)
            {
                quant = qp[x+temp];
                if (quant > maxquant) maxquant = quant;
                if (quant < minquant) minquant = quant;
                avgquant += quant;
            }
        }
        avgquant = (int)(((float)avgquant/(float)(mb_height*mb_width)) + 0.5f);
    }

    if (showQ)
    {
        int x, y;
        for(y=0; y<this->mb_height; y++)
        {
            for(x=0;x<this->mb_width; x++)
            {
                MBnum(&dst->y[x*16+y*16*dst->ypitch],dst->ypitch,qp[x+y*this->mb_width]);
            }
        }
    }

#ifdef PROFILING
    stop_timer(&tim.post);
    start_timer();
#endif
}
コード例 #5
0
ファイル: NoteData.cpp プロジェクト: Fighter19/PSPMania
void NoteData::From4s( const NoteData &out )
{
	CopyAll( &out );
	Convert4sToHoldNotes();
}
コード例 #6
0
ファイル: NoteData.cpp プロジェクト: Fighter19/PSPMania
void NoteData::To4s( const NoteData &out )
{
	CopyAll( &out );
	ConvertHoldNotesTo4s();
}
コード例 #7
0
ファイル: NoteData.cpp プロジェクト: Fighter19/PSPMania
void NoteData::From2sAnd3s( const NoteData &out )
{
	CopyAll( &out );
	Convert2sAnd3sToHoldNotes();
}
コード例 #8
0
ファイル: Garnet.c プロジェクト: slsewall/GarnetLanguage
GarnetPtr &GarnetPtr::operator=(const GarnetPtr &rhs){
	CopyAll(rhs);
	return *this;
}
コード例 #9
0
ファイル: Garnet.c プロジェクト: slsewall/GarnetLanguage
GarnetPtr::GarnetPtr(const GarnetPtr &init){
	CopyAll(init);
}
コード例 #10
0
/**
 * The only process we are really guaranteed to have is this test process itself.
 * This test uses the generic filter function.
 */
TEST(Process_List_Test, find_our_process_CI_as_used)
{
  std::vector<PROCESSENTRY32W> v;
  initialize_process_list(v, process_by_any_file_name_CI(FileNameSet(multiple_exe_names)), CopyAll());
  size_t size(v.size());
  EXPECT_EQ(1u, size);      // Please, don't run multiple test executables simultaneously
  ASSERT_GE(1u, size);
}
コード例 #11
0
/**
 * Construction test ensures that we don't throw and that at least one process shows up.
 */
TEST(Process_List_Test, construct_vector)
{
  std::vector<PROCESSENTRY32W> v;
  initialize_process_list(v, EveryProcess(), CopyAll());
  ASSERT_GE(v.size(), 1u);
}
コード例 #12
0
ファイル: HexMergeDoc.cpp プロジェクト: seanedwards/COS-420
/**
 * @brief Copy all bytes from right to left
 */
void CHexMergeDoc::OnAllLeft()
{
	CopyAll(m_pView[MERGE_VIEW_RIGHT], m_pView[MERGE_VIEW_LEFT]);
}