MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / decimation_mode

Class decimation_mode

Source/astcenc_internal.h:449–512  ·  view source on GitHub ↗

* @brief Metadata for single decimation mode for a specific block size. */

Source from the content-addressed store, hash-verified

447 * @brief Metadata for single decimation mode for a specific block size.
448 */
449struct decimation_mode
450{
451 /** @brief The max weight precision for 1 plane, or -1 if not supported. */
452 int8_t maxprec_1plane;
453
454 /** @brief The max weight precision for 2 planes, or -1 if not supported. */
455 int8_t maxprec_2planes;
456
457 /**
458 * @brief Bitvector indicating weight quant modes used by active 1 plane block modes.
459 *
460 * Bit 0 = QUANT_2, Bit 1 = QUANT_3, etc.
461 */
462 uint16_t refprec_1plane;
463
464 /**
465 * @brief Bitvector indicating weight quant methods used by active 2 plane block modes.
466 *
467 * Bit 0 = QUANT_2, Bit 1 = QUANT_3, etc.
468 */
469 uint16_t refprec_2planes;
470
471 /**
472 * @brief Set a 1 plane weight quant as active.
473 *
474 * @param weight_quant The quant method to set.
475 */
476 void set_ref_1plane(quant_method weight_quant)
477 {
478 refprec_1plane |= (1 << weight_quant);
479 }
480
481 /**
482 * @brief Test if this mode is active below a given 1 plane weight quant (inclusive).
483 *
484 * @param max_weight_quant The max quant method to test.
485 */
486 bool is_ref_1plane(quant_method max_weight_quant) const
487 {
488 uint16_t mask = static_cast<uint16_t>((1 << (max_weight_quant + 1)) - 1);
489 return (refprec_1plane & mask) != 0;
490 }
491
492 /**
493 * @brief Set a 2 plane weight quant as active.
494 *
495 * @param weight_quant The quant method to set.
496 */
497 void set_ref_2plane(quant_method weight_quant)
498 {
499 refprec_2planes |= static_cast<uint16_t>(1 << weight_quant);
500 }
501
502 /**
503 * @brief Test if this mode is active below a given 2 plane weight quant (inclusive).
504 *
505 * @param max_weight_quant The max quant method to test.
506 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected