Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/gpu/drm/i915/display/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 24 kB image not shown  

Quelle  intel_qp_tables.c

  Sprache: C
 

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2021 Intel Corporation
 */


#include <drm/display/drm_dsc.h>

#include "i915_utils.h"
#include "intel_qp_tables.h"

/* from BPP 6 to 24 in steps of 0.5 */
#define RC_RANGE_QP444_8BPC_MAX_NUM_BPP  37

/* from BPP 6 to 30 in steps of 0.5 */
#define RC_RANGE_QP444_10BPC_MAX_NUM_BPP 49

/* from BPP 6 to 36 in steps of 0.5 */
#define RC_RANGE_QP444_12BPC_MAX_NUM_BPP 61

/* For YCbCr420 the bits_per_pixel sent in PPS params
 * is double the target bpp. The below values represent
 * the target bpp.
 */

/* from BPP 4 to 12 in steps of 0.5 */
#define RC_RANGE_QP420_8BPC_MAX_NUM_BPP  17

/* from BPP 4 to 15 in steps of 0.5 */
#define RC_RANGE_QP420_10BPC_MAX_NUM_BPP 23

/* from BPP 4 to 18 in steps of 0.5 */
#define RC_RANGE_QP420_12BPC_MAX_NUM_BPP 29

/*
 * These qp tables are as per the C model
 * and it has the rows pointing to bpps which increment
 * in steps of 0.5
 */

static const u8 rc_range_minqp444_8bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_8BPC_MAX_NUM_BPP] = {
 { 00000000000000000000000,
   00000000000000 },
 { 11000000000000000000000,
   00000000000000 },
 { 32221111111111100000000,
   00000000000000 },
 { 33221111111111110000000,
   00000000000000 },
 { 54433333333333211111111,
   11111000000000 },
 { 54443333333333321111111,
   11111110000000 },
 { 55443333333333322211111,
   11111110000000 },
 { 55443333333333322222222,
   22211111100000 },
 { 55443333333333322222222,
   22222111111000 },
 { 65544433333333333333333,
   33322111111000 },
 { 66555555555554444444443,
   33322111111110 },
 { 66655555555555555444444,
   44433222211110 },
 { 66665555555555555555554,
   44433222211110 },
 { 99998877777777777777665,
   55544333322111 },
 { 141413131212121211111010101099988,
   877776655554443333 }
};

static const u8 rc_range_maxqp444_8bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_8BPC_MAX_NUM_BPP] = {
 { 44444433332222111000000,
   00000000000000 },
 { 66554444444433322111111,
   11111111100000 },
 { 87765555555544432211111,
   11111111100000 },
 { 88776666666655543322222,
   22211111111110 },
 { 98877777777766544322222,
   22222111111110 },
 { 98887777777766654433333,
   33322221111111 },
 { 99887777777776654433333,
   33322221111111 },
 { 1010998888888887765544443,
   33322222211111 },
 { 11111010999999888776655555,
   444433222222111 },
 { 121111101010999999988766555,
   5444433222222111 },
 { 121211111010101010109998877666,
   55444433222222221 },
 { 121212111111101010109999888777,
   66555544333322221 },
 { 1212121211111111111010999888777,
   66555544333322221 },
 { 131313131212111111111010101099888,
   877666655444433222 },
 { 15151414131313131212111111111010109,
   9988887766665554444 }
};

static const u8 rc_range_minqp444_10bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_10BPC_MAX_NUM_BPP] = {
 { 00000000000000000000000,
   00000000000000000000000,
   000 },
 { 44444444443322222222211,
   11111111100000000000000,
   000 },
 { 76665555555544433333322,
   22211111111100000000000,
   000 },
 { 77665555555544444444433,
   33322222222221100000000,
   000 },
 { 98877777777766555544443,
   33333222222221111000000,
   000 },
 { 98887777777766665555554,
   44433333222222222111000,
   000 },
 { 99887777777777766655555,
   44433333333333222111100,
   000 },
 { 99887777777777776666665,
   55544444433333322221110,
   000 },
 { 99887777777777777666665,
   55555544444333333222111,
   100 },
 { 109988877777777777766666,
   66666554444333333322211,
   110 },
 { 1010999999999998888777776,
   66666555555554443332221,
   111 },
 { 1010109999999999999988888,
   77777766665555444433332,
   2111 },
 { 10101010999999999999999988,
   88887766665555444433332,
   2221 },
 { 1212121212121212121211111111111111,
   111111101099998877776655554,
   4333322221 },
 { 1818171716161616151514141414131313,
   12121211111111101099999887777,
   766555544333 }
};

static const u8 rc_range_maxqp444_10bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_10BPC_MAX_NUM_BPP] = {
 { 88888877765544333222222,
   11111111111111000000000,
   000 },
 { 1010998888887766655444433,
   33322222211111110000000,
   000 },
 { 12111110999999998887665554,
   44443333332221111110000,
   0000 },
 { 1212111110101010101010109998776,
   66555554433333333221111,
   1000000 },
 { 13121211111111111111111110109887,
   66665555554443333322221,
   11100000 },
 { 131212121111111111111111101010988,
   77776666555543333333332,
   22111100 },
 { 131312121111111111111111111010988,
   77777666555544444443332,
   22211111 },
 { 1414131312121212121212121211111099,
   88887777666555444444333,
   32221111 },
 { 15151414131313131313121212111110109,
   99998888776555554444443,
   33222211 },
 { 1615151414141313131313131312121110,
   109999888877665555444444,
   433322221 },
 { 1616151514141414141413131312121111,
   1010109988887766666666555,
   4443332222 },
 { 1616161515151414141413131313121212,
   111111101099998877776666555,
   5444433222 },
 { 1616161615151515151414131313121212,
   111111101099998877776666555,
   5444433332 },
 { 1717171716161515151514141414131312,
   12121211111010101099888877666,
   655444433332 },
 { 1919181817171717161615151515141414,
   131313121212121111101010101099888,
   8877666655444 }
};

static const u8 rc_range_minqp444_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_12BPC_MAX_NUM_BPP] = {
 { 00000000000000000000000000,
   00000000000000000000000000,
   000000000 },
 { 55554444444444433222222222,
   11111100000000000000000000,
   000000000 },
 { 1110109888888887776554443333,
   32222221111111111110000000,
   0000000000 },
 { 1111101099999999888766666555,
   55443333333322222221111110,
   00000000000 },
 { 13121211111111111111111110109998777,
   7555555444333333333222211,
   111000000000000 },
 { 131212121111111111111111111111109988,
   88666655555444444444333222,
   211111100000000 },
 { 131312121111111111111111111111109999,
   99988877765555555444444433,
   322111111100000 },
 { 13131212111111111111111111111111101010,
   1010109999888777666666555544,
   43322222211110000 },
 { 13131212111111111111111111111111111111,
   111111101010109987777766666655,
   5444433222211111100 },
 { 14131312121211111111111111111111111111,
   111111101010109988888877777665,
   5544443333322222110 },
 { 14141313131313131313131313131312121212,
   12111111111111101099999999888777,
   6665555443332222111 },
 { 14141413131313131313131313131313131313,
   1312121111111111111010101099998888,
   777766555444333322111 },
 { 14141414131313131313131313131313131313,
   1312121212121211111010101099998888,
   777766665444333322111 },
 { 17171717161615151515151515151515151515,
   151414131313131212111111111010999988,
   777776665555443333221 },
 { 22222121202020201919181818181717171616,
   16151515151414131313131312121111111111,
   1010999998877777665555443 }
};

static const u8 rc_range_maxqp444_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_12BPC_MAX_NUM_BPP] = {
 { 12121212121211111110996655544444,
   43333322222222211111110000,
   0000000000000 },
 { 1414131312121212121211119998877775,
   55554443332222222111111111,
   1000000000000 },
 { 16151514131313131313131312121211101099,
   97777766555544433333322211,
   111000000000000 },
 { 16161515141414141414141413131312111110,
   101088888776555555544333332,
   22222110000000000 },
 { 17161615151515151515151514141312121110,
   1010108888887776655544443333,
   22222111111111100 },
 { 17161616151515151515151514141413121211,
   1111119999888876666655554443,
   33322222211111110 },
 { 17171616151515151515151515141413121211,
   111111111010109998777777766655,
   5544433222222211110 },
 { 18181717161616161616161616151514131312,
   12121211111111101010888777777666,
   65554433333322221111 },
 { 19191818171717171717161616151514141313,
   13131312121212111110988887777776,
   66555544333322222211 },
 { 20191918181817171717171717161615141413,
   131313121212121111101099998888877,
   66655554444433333221 },
 { 20201919181818181818171717161615151414,
   1413131212121211111010101010101010999,
   8887776666554443333222 },
 { 20202019191918181818171717171616161515,
   1514141313131312121111111110101010999,
   9888877666555444433222 },
 { 20202020191919191918181717171616161515,
   1514141313131312121111111110101010999,
   9888877776555444433222 },
 { 21212121202019191919181818181717161616,
   16151514141414131312121212111110101010,
   99888887776666554444332 },
 { 23232222212121212020191919191818181717,
   17161616161515141414141413131212121212,
   111110101010109988888776666554 }
};

static const u8 rc_range_minqp420_8bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_8BPC_MAX_NUM_BPP] = {
 { 00000000000000000 },
 { 00000000000000000 },
 { 11111110000000000 },
 { 11111111000000000 },
 { 33333211111110000 },
 { 33333221111111000 },
 { 33333322111111100 },
 { 33333322222221110 },
 { 33333322222222110 },
 { 33333333333332211 },
 { 55555444443333211 },
 { 55555554444443221 },
 { 55555555555443321 },
 { 98877777765543332 },
 { 13121211101098876655443 }
};

static const u8 rc_range_maxqp420_8bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_8BPC_MAX_NUM_BPP] = {
 { 44332211000000000 },
 { 44444322111100000 },
 { 55555432111111000 },
 { 66666543222111100 },
 { 77777543222221110 },
 { 77777654333222110 },
 { 77777654333322211 },
 { 88888765444332221 },
 { 99988766554433221 },
 { 1010999876555443322 },
 { 10101099887665544322 },
 { 111110109987766554332 },
 { 111111109998776554432 },
 { 13121211101098876654443 },
 { 141313121111109987766554 }
};

static const u8 rc_range_minqp420_10bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_10BPC_MAX_NUM_BPP] = {
 { 00000000000000000000000 },
 { 44432222222210000000000 },
 { 44433333322222100000000 },
 { 55544444433222210000000 },
 { 77766554433332221110000 },
 { 77777655555433221111100 },
 { 77777665555444322221110 },
 { 77777766666544432221110 },
 { 77777777666655443322211 },
 { 77777777777665544332211 },
 { 99999888887766554433221 },
 { 99999988888887665443321 },
 { 99999999999887765443321 },
 { 1312121111111111111099877655433,
   22 },
 { 171616151414131212111010109887665,
   544 }
};

static const u8 rc_range_maxqp420_10bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_10BPC_MAX_NUM_BPP] = {
 { 88764433211111000000000 },
 { 88876544333321110000000 },
 { 99988765433333211100000 },
 { 1010109987654433332111110,
   0 },
 { 111111101087654444333222111,
   0 },
 { 111111101098766654433222221,
   1 },
 { 1111111111109877765543333222,
   1 },
 { 1212121212111098887655433322,
   21 },
 { 13131312121110109988776544333,
   22 },
 { 14141313131211109998877654433,
   22 },
 { 141414131312121110109988765544,
   332 },
 { 1515141413131211111010998776554,
   432 },
 { 1515151413131312111110998876554,
   432 },
 { 17161615141413121211101098876654,
   433 },
 { 181717161515141313121111111099877,
   6655 }
};

static const u8 rc_range_minqp420_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_12BPC_MAX_NUM_BPP] = {
 { 000000000000000000000000,
   00000 },
 { 444444332222222100000000,
   00000 },
 { 988776554444333221000000,
   00000 },
 { 1099888776665544322111000,
   00000 },
 { 111010101099876666554333221,
   0000000 },
 { 11111111111010999987655443332,
   1100000 },
 { 111111111111101099988765555433,
   2111110 },
 { 11111111111111101010109888766544,
   32211111 },
 { 11111111111111111111101099887765,
   544221111 },
 { 111111111111111111111110109988776,
   544322111 },
 { 1313131313131312121211111010998877,
   654332211 },
 { 13131313131313131312121212111010988,
   7765433221 },
 { 13131313131313131313131212111110988,
   7765443221 },
 { 15151515151515151514131312111110998,
   8766544332 },
 { 212020191818171616151414141312121110,
   1010988766554 }
};

static const u8 rc_range_maxqp420_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_12BPC_MAX_NUM_BPP] = {
 { 1110986655433222111111100,
   000000 },
 { 12111110987766554332111111,
   1000000 },
 { 1312121111109876665543321111,
   1000000 },
 { 14131312121110987766554332221,
   1100000 },
 { 15141413131110987777665444332,
   1110000 },
 { 1515151414131211101010987665544,
   432211000 },
 { 15151515151413121111111098766665,
   443222110 },
 { 161616161615141312121211109987765,
   543322211 },
 { 1717171616151414131312121111109887,
   6655332211 },
 { 18181717171615141313131212111110988,
   7655433221 },
 { 18181817171616151414131312121110998,
   8765443322 },
 { 19191818171716151514141313121111109,
   98876544332 },
 { 19191918171717161515141313121211109,
   98876554332 },
 { 212020191818171616151414131212111010,
   99877655443 },
 { 222121201919181717161515151413131211,
   11111099877665 }
};

#define PARAM_TABLE(_minmax, _bpc, _row, _col, _is_420)  do { \
 if (bpc == (_bpc)) { \
  if (_is_420) \
   return rc_range_##_minmax##qp420_##_bpc##bpc[_row][_col]; \
  else \
   return rc_range_##_minmax##qp444_##_bpc##bpc[_row][_col]; \
 } \
while (0)

u8 intel_lookup_range_min_qp(int bpc, int buf_i, int bpp_i, bool is_420)
{
 PARAM_TABLE(min, 8, buf_i, bpp_i, is_420);
 PARAM_TABLE(min, 10, buf_i, bpp_i, is_420);
 PARAM_TABLE(min, 12, buf_i, bpp_i, is_420);

 MISSING_CASE(bpc);
 return 0;
}

u8 intel_lookup_range_max_qp(int bpc, int buf_i, int bpp_i, bool is_420)
{
 PARAM_TABLE(max, 8, buf_i, bpp_i, is_420);
 PARAM_TABLE(max, 10, buf_i, bpp_i, is_420);
 PARAM_TABLE(max, 12, buf_i, bpp_i, is_420);

 MISSING_CASE(bpc);
 return 0;
}

Messung V0.5 in Prozent
C=97 H=93 G=94

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-06-08) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.