static void DTS_Band(short[] bandData, BandType_Values band, TileComponents component, RFX_PROGRESSIVE_CODEC_QUANT quants) { int bitPos = RdpegfxTileUtils.GetBitPosForQuant(quants, component, band); for (int i = 0; i < bandData.Length; i++) { bandData[i] = FunDTS(bandData[i], bitPos, band); } }
static void DTS_Band(short[] bandData, BandType_Values band, TileComponents component, ProgressiveChunk_Values chunk) { int bitPos = RdpegfxTileUtils.GetBitPosForChunk(chunk, component, band); for (int i = 0; i < bandData.Length; i++) { bandData[i] = FunDTS(bandData[i], bitPos, band); } }
/// <summary> /// Get the bit-pos for a given chunk /// </summary> /// <param name="chunk">The chunk</param> /// <param name="component">The compoent</param> /// <param name="band">The band</param> /// <returns>The bit-pos of the given band for the given chunk</returns> public static int GetBitPosForQuant(RFX_PROGRESSIVE_CODEC_QUANT quants, TileComponents component, BandType_Values band) { RFX_COMPONMENT_CODEC_QUANT quantsComponet = quants.yQuantValues; switch (component) { case TileComponents.Y: quantsComponet = quants.yQuantValues; break; case TileComponents.Cb: quantsComponet = quants.cbQuantValues; break; case TileComponents.Cr: quantsComponet = quants.crQuantValues; break; } switch (band) { case BandType_Values.LL3: return(quantsComponet.LL3_HL3 & 0x0F); case BandType_Values.HL3: return(quantsComponet.LL3_HL3 >> 4); case BandType_Values.LH3: return(quantsComponet.LH3_HH3 & 0x0F); case BandType_Values.HH3: return(quantsComponet.LH3_HH3 >> 4); case BandType_Values.HL2: return(quantsComponet.HL2_LH2 & 0x0F); case BandType_Values.LH2: return(quantsComponet.HL2_LH2 >> 4); case BandType_Values.HH2: return(quantsComponet.HH2_HL1 & 0x0F); case BandType_Values.HL1: return(quantsComponet.HH2_HL1 >> 4); case BandType_Values.LH1: return(quantsComponet.LH1_HH1 & 0x0F); case BandType_Values.HH1: return(quantsComponet.LH1_HH1 >> 4); default: return(0); } }
/// <summary> /// Get the bit-pos for a given chunk /// </summary> /// <param name="chunk">The chunk</param> /// <param name="component">The compoent</param> /// <param name="band">The band</param> /// <returns>The bit-pos of the given band for the given chunk</returns> public static int GetBitPosForChunk(ProgressiveChunk_Values chunk, TileComponents component, BandType_Values band) { if (chunk == ProgressiveChunk_Values.kChunk_None) { return(15); // no matter what the band or the component } else if (chunk == ProgressiveChunk_Values.kChunk_100) { return(0); } return(gProgressiveBitPosArray[(int)component, (int)chunk, (int)band]); }
protected static void DTS_Component(DwtBands dwt, TileComponents component, RFX_PROGRESSIVE_CODEC_QUANT quants) { //HL1, LH1, HH1, HL2, LH2, HH2, HL3, LH3, HH3, and LL3 DTS_Band(dwt.HL1, BandType_Values.HL1, component, quants); DTS_Band(dwt.LH1, BandType_Values.LH1, component, quants); DTS_Band(dwt.HH1, BandType_Values.HH1, component, quants); DTS_Band(dwt.HL2, BandType_Values.HL2, component, quants); DTS_Band(dwt.LH2, BandType_Values.LH2, component, quants); DTS_Band(dwt.HH2, BandType_Values.HH2, component, quants); DTS_Band(dwt.HL3, BandType_Values.HL3, component, quants); DTS_Band(dwt.LH3, BandType_Values.LH3, component, quants); DTS_Band(dwt.HH3, BandType_Values.HH3, component, quants); DTS_Band(dwt.LL3, BandType_Values.LL3, component, quants); }
protected static void DTS_Component(DwtBands dwt, TileComponents component, ProgressiveChunk_Values chunk) { //HL1, LH1, HH1, HL2, LH2, HH2, HL3, LH3, HH3, and LL3 DTS_Band(dwt.HL1, BandType_Values.HL1, component, chunk); DTS_Band(dwt.LH1, BandType_Values.LH1, component, chunk); DTS_Band(dwt.HH1, BandType_Values.HH1, component, chunk); DTS_Band(dwt.HL2, BandType_Values.HL2, component, chunk); DTS_Band(dwt.LH2, BandType_Values.LH2, component, chunk); DTS_Band(dwt.HH2, BandType_Values.HH2, component, chunk); DTS_Band(dwt.HL3, BandType_Values.HL3, component, chunk); DTS_Band(dwt.LH3, BandType_Values.LH3, component, chunk); DTS_Band(dwt.HH3, BandType_Values.HH3, component, chunk); DTS_Band(dwt.LL3, BandType_Values.LL3, component, chunk); }
static void ProgressiveQuantization_Band(short[] bandData, BandType_Values band, TileComponents component, RFX_PROGRESSIVE_CODEC_QUANT quants) { int bitPos = RdpegfxTileUtils.GetBitPosForQuant(quants, component, band); for (int i = 0; i < bandData.Length; i++) { bandData[i] = FunProgQ(bandData[i], bitPos, band); } }
static void ProgressiveQuantization_Band(short[] bandData, BandType_Values band, TileComponents component, ProgressiveChunk_Values chunk) { int bitPos = RdpegfxTileUtils.GetBitPosForChunk(chunk, component, band); for (int i = 0; i < bandData.Length; i++) { bandData[i] = FunProgQ(bandData[i], bitPos, band); } }
protected static void ProgressiveQuantization_Component(DwtBands dwt, TileComponents component, RFX_PROGRESSIVE_CODEC_QUANT quants) { //HL1, LH1, HH1, HL2, LH2, HH2, HL3, LH3, HH3, and LL3 ProgressiveQuantization_Band(dwt.HL1, BandType_Values.HL1, component, quants); ProgressiveQuantization_Band(dwt.LH1, BandType_Values.LH1, component, quants); ProgressiveQuantization_Band(dwt.HH1, BandType_Values.HH1, component, quants); ProgressiveQuantization_Band(dwt.HL2, BandType_Values.HL2, component, quants); ProgressiveQuantization_Band(dwt.LH2, BandType_Values.LH2, component, quants); ProgressiveQuantization_Band(dwt.HH2, BandType_Values.HH2, component, quants); ProgressiveQuantization_Band(dwt.HL3, BandType_Values.HL3, component, quants); ProgressiveQuantization_Band(dwt.LH3, BandType_Values.LH3, component, quants); ProgressiveQuantization_Band(dwt.HH3, BandType_Values.HH3, component, quants); ProgressiveQuantization_Band(dwt.LL3, BandType_Values.LL3, component, quants); }
protected static void ProgressiveQuantization_Component(DwtBands dwt, TileComponents component, ProgressiveChunk_Values chunk) { //HL1, LH1, HH1, HL2, LH2, HH2, HL3, LH3, HH3, and LL3 ProgressiveQuantization_Band(dwt.HL1, BandType_Values.HL1, component, chunk); ProgressiveQuantization_Band(dwt.LH1, BandType_Values.LH1, component, chunk); ProgressiveQuantization_Band(dwt.HH1, BandType_Values.HH1, component, chunk); ProgressiveQuantization_Band(dwt.HL2, BandType_Values.HL2, component, chunk); ProgressiveQuantization_Band(dwt.LH2, BandType_Values.LH2, component, chunk); ProgressiveQuantization_Band(dwt.HH2, BandType_Values.HH2, component, chunk); ProgressiveQuantization_Band(dwt.HL3, BandType_Values.HL3, component, chunk); ProgressiveQuantization_Band(dwt.LH3, BandType_Values.LH3, component, chunk); ProgressiveQuantization_Band(dwt.HH3, BandType_Values.HH3, component, chunk); ProgressiveQuantization_Band(dwt.LL3, BandType_Values.LL3, component, chunk); }
/// <summary> /// Get the bit-pos for a given chunk /// </summary> /// <param name="chunk">The chunk</param> /// <param name="component">The compoent</param> /// <param name="band">The band</param> /// <returns>The bit-pos of the given band for the given chunk</returns> public static int GetBitPosForQuant(RFX_PROGRESSIVE_CODEC_QUANT quants, TileComponents component, BandType_Values band) { RFX_COMPONMENT_CODEC_QUANT quantsComponet = quants.yQuantValues; switch (component) { case TileComponents.Y: quantsComponet = quants.yQuantValues; break; case TileComponents.Cb: quantsComponet = quants.cbQuantValues; break; case TileComponents.Cr: quantsComponet = quants.crQuantValues; break; } switch (band) { case BandType_Values.LL3: return quantsComponet.LL3_HL3 & 0x0F; case BandType_Values.HL3: return quantsComponet.LL3_HL3 >> 4; case BandType_Values.LH3: return quantsComponet.LH3_HH3 & 0x0F; case BandType_Values.HH3: return quantsComponet.LH3_HH3 >> 4; case BandType_Values.HL2: return quantsComponet.HL2_LH2 & 0x0F; case BandType_Values.LH2: return quantsComponet.HL2_LH2 >> 4; case BandType_Values.HH2: return quantsComponet.HH2_HL1 & 0x0F; case BandType_Values.HL1: return quantsComponet.HH2_HL1 >> 4; case BandType_Values.LH1: return quantsComponet.LH1_HH1 & 0x0F; case BandType_Values.HH1: return quantsComponet.LH1_HH1 >> 4; default: return 0; } }
/// <summary> /// Get the bit-pos for a given chunk /// </summary> /// <param name="chunk">The chunk</param> /// <param name="component">The compoent</param> /// <param name="band">The band</param> /// <returns>The bit-pos of the given band for the given chunk</returns> public static int GetBitPosForChunk(ProgressiveChunk_Values chunk, TileComponents component, BandType_Values band) { if (chunk == ProgressiveChunk_Values.kChunk_None) return 15; // no matter what the band or the component else if (chunk == ProgressiveChunk_Values.kChunk_100) return 0; return gProgressiveBitPosArray[(int)component, (int)chunk, (int)band]; }