Linear Predictive Coding: Difference between revisions

From mywiki
Jump to navigation Jump to search
Line 53: Line 53:
* subframe->quantization_level = 13 0xd
* subframe->quantization_level = 13 0xd
* decoder->private_->output[channel]+order = 0x5555558599c0 +0x8*8(32 Bits) = 0x5555558599c0 + 0x40 = 0x555555859A00
* decoder->private_->output[channel]+order = 0x5555558599c0 +0x8*8(32 Bits) = 0x5555558599c0 + 0x40 = 0x555555859A00
|-
|1238 ||LPC || ''void FLAC__lpc_restore_signal_wide(const FLAC__int32 * flac_restrict residual, uint32_t data_len, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order, int lp_quantization, FLAC__int32 * flac_restrict data)''
* residual = 0xfffffb81 = -1151
* data_len = 4088 = 0xff8
* qlp_coeff = 0x555555859efc address to start of 32 bit array
* order = 8
* lp_quantization = 13 0xd
* data = 0x55555585f350 '''''Looks like this is a virgin address need to check'''''
|}
|}



Revision as of 17:49, 13 February 2025


EditDate 2025-2-13

Related Threads: Arts, Anarchist Spellbook, Religion and Philosophy, STEM

This is the heart of both fLaC compression and predicting the next sound, I think

Going to decode here and see how easily it can be introduced into my playAlong code.Web References https://en.wikipedia.org/wiki/Linear prediction

Linear Predictive Coding

Frame Header 2
Line Number Code Package LOC purpose Operation Description
2987 SDC read_residual_partitioned_rice sample += u;

Key parameters

  • sample = 4088 for partition 0 4096 thereafter
2883 SDC read_subframe_lpc break
2889 SDC Do Full Decode
2892 SDC Get Warm-up values 8 previously stored warm-up values based on order=8
2894 SDC call FLAC lpc max bps
960 LPC FLAC__lpc_max_residual_bps Variables
  • uint32_t subframe_bps = 24
  • const FLAC__int32 * flac_restrict qlp_coeff : 0x555555859EFC <Hex>
 Address           0 - 3     4 - 7     8 - B     C - F               
 0000555555859EF0  08000000  0F000000  0D000000  E51D0000          
 0000555555859F00  282E0000  E0E2FFFF  F4CFFFFF  170C0000          
 0000555555859F10  17210000  72010000  6EF2FFFF      
  • uint32_t order = 8
  • int lp_quantization = 13 0xD
948 LPC FLAC__lpc_max_prediction_before_shift_bps FLAC__int32 abs_sum_of_qlp_coeff = 0;
951 LPC FLAC__lpc_max_prediction_before_shift_bps iterative based on i < order = 8 abs_sum_of_qlp_coeff += abs(qlp_coeff[i]);
  • abs_sum_of_qlp_coeff = 0xd56b = 54635
  • if abs_sum_of_qlp_coeff = 0 = 1
2898 SDC read_subframe_lpc_ FLAC__lpc_restore_signal_wide FLAC__lpc_restore_signal_wide(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
  • channel = 0
  • order = 8
  • decoder->private_->residual[channel] = 0x555555863340 memory address
  • decoder->private_->frame.header.blocksize-order = 4096 - 8 = 4088 = 0xff8
  • subframe->qlp_coeff = 0x555555859efc address to start of 32 bit array
  • subframe->quantization_level = 13 0xd
  • decoder->private_->output[channel]+order = 0x5555558599c0 +0x8*8(32 Bits) = 0x5555558599c0 + 0x40 = 0x555555859A00
1238 LPC void FLAC__lpc_restore_signal_wide(const FLAC__int32 * flac_restrict residual, uint32_t data_len, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order, int lp_quantization, FLAC__int32 * flac_restrict data)
  • residual = 0xfffffb81 = -1151
  • data_len = 4088 = 0xff8
  • qlp_coeff = 0x555555859efc address to start of 32 bit array
  • order = 8
  • lp_quantization = 13 0xd
  • data = 0x55555585f350 Looks like this is a virgin address need to check


Next Edit

Pertinent Code

960 LPC FLAC__int32 predictor_sum_bps = FLAC__lpc_max_prediction_before_shift_bps(subframe_bps, qlp_coeff, order) - lp_quantization; 1264 LPC *(data++) = (FLAC__int32)(*(r++) + (sum >> lp_quantization)); First result:

  • Little Endian in Memory C670FFFF
  • Big Endian as read FFFF70C6
  • testBigEndian.raw 0030 FF70C6

Notes for code analysis

4 bytes / int 32 Bits.

little endian memory dump of in storage buffer

19 7F D1 4F 19 7F D1 4F 19 7F D1 4F FD 44 01 37  56 26 0A 25 B2 EE F6 7F 9D 10 5D 79 62 33 5B 9F B4 0E 65 24 15 7A 35 13 370144FD4FD17F19 at 2380 in test.flac.

File

3701 44FD 4FD1 4FD1 7F19 7FF6 EEB2 250A 2656 does not line up with contiguous memory location.  Only 64 bit word valid in memory (if reversed) 
loc 2380 in file

word