• Laurent THOMAS's avatar
    Improve polar decoder/encoder · d57ea715
    Laurent THOMAS authored
    - Ensure packed struct through bitfield
    - decoder tree buffer increase: i don't find evidence in the 3GPP
      standard of the max size of polar coded PDU.  even with this max size,
      the way this tree is built is not trivial.  so, it is hard to predict,
      i just put 8 system pages (32KB) that looks enough [1]
    - a lot of reformatting
    
    [1] https://arxiv.org/pdf/1804.04389
    according to this paper, the largest polar code in 5G is in UL, so
    likely the biggest problem will be in gNB, not the UE.  in DL, the max
    output coded block is 512, in UL 1024.  probably the tree we discuss is
    related to this size.
    
    "frozen bits" means only bits we don't encode/decode because polar code
    size is only by power of 2.
    We see this in OAI code:  NR_POLAR_PUCCH_N_MAX is 10, so 2^10 is 1024,
    that is the maximum size for 5G polar code length.  in the code, we
    assert if N > 512: "N = %d, not done yet\n",
    polarParams->N".  so, the today OAI code can't do PUCCH large blocks.
    
    using current oai limitation of 2⁹ max code size, we can create up to
    2^9+2⁸... nodes, so 1023 nodes in the tree.  the problem then is that
    each node have variable size, depending on the 'level' (the power of 2
    we are currently).  the algo provision large alpha and beta to be able
    to store all lower levels in the tree (int leaf_sz = 1 << level)
    therefore upper tree nodes are large (the top level for n=9 uses about
    1.5KB) and the bottom nodes uses 64 bytes.  if all nodes are populated,
    the size will be very large: 1.5KB + 2 * 800 + ....  but, we create
    nodes in the tree only for the "information bits", so the payload, that
    is limited to 128 bits (else we assert, the code is not "finished").
    1.5KB * 128 is >> 8KB i allocated.  but, we can't create more than one
    mode at top level, so there is maximum 1.5KB + 2 * 800, + 4 * 400 + 8 *
    200 + 16 * 100 + remaining of 128-32 nodes of 64 bytes.  about 14KB.
    
    i allocated 1024*sizeof(__m256i) bytes = 32KB that looks good.
    d57ea715
nr_polar_procedures.c 9.86 KB