Coverage Report

Created: 2025-11-14 07:32

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libjxl/lib/jxl/entropy_coder.h
Line
Count
Source
1
// Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
//
3
// Use of this source code is governed by a BSD-style
4
// license that can be found in the LICENSE file.
5
6
#ifndef LIB_JXL_ENTROPY_CODER_H_
7
#define LIB_JXL_ENTROPY_CODER_H_
8
9
#include <jxl/memory_manager.h>
10
11
#include <cstddef>
12
#include <cstdint>
13
14
#include "lib/jxl/ac_context.h"
15
#include "lib/jxl/base/compiler_specific.h"
16
#include "lib/jxl/base/status.h"
17
#include "lib/jxl/dec_bit_reader.h"
18
#include "lib/jxl/field_encodings.h"
19
20
// Entropy coding and context modeling of DC and AC coefficients, as well as AC
21
// strategy and quantization field.
22
23
namespace jxl {
24
25
static JXL_INLINE int32_t PredictFromTopAndLeft(
26
    const int32_t* const JXL_RESTRICT row_top,
27
7.66M
    const int32_t* const JXL_RESTRICT row, size_t x, int32_t default_val) {
28
7.66M
  if (x == 0) {
29
380k
    return row_top == nullptr ? default_val : row_top[x];
30
380k
  }
31
7.28M
  if (row_top == nullptr) {
32
348k
    return row[x - 1];
33
348k
  }
34
6.93M
  return (row_top[x] + row[x - 1] + 1) / 2;
35
7.28M
}
Unexecuted instantiation: enc_context_map.cc:jxl::PredictFromTopAndLeft(int const*, int const*, unsigned long, int)
enc_entropy_coder.cc:jxl::PredictFromTopAndLeft(int const*, int const*, unsigned long, int)
Line
Count
Source
27
6.41M
    const int32_t* const JXL_RESTRICT row, size_t x, int32_t default_val) {
28
6.41M
  if (x == 0) {
29
309k
    return row_top == nullptr ? default_val : row_top[x];
30
309k
  }
31
6.11M
  if (row_top == nullptr) {
32
279k
    return row[x - 1];
33
279k
  }
34
5.83M
  return (row_top[x] + row[x - 1] + 1) / 2;
35
6.11M
}
Unexecuted instantiation: dec_frame.cc:jxl::PredictFromTopAndLeft(int const*, int const*, unsigned long, int)
dec_group.cc:jxl::PredictFromTopAndLeft(int const*, int const*, unsigned long, int)
Line
Count
Source
27
1.24M
    const int32_t* const JXL_RESTRICT row, size_t x, int32_t default_val) {
28
1.24M
  if (x == 0) {
29
71.1k
    return row_top == nullptr ? default_val : row_top[x];
30
71.1k
  }
31
1.17M
  if (row_top == nullptr) {
32
68.5k
    return row[x - 1];
33
68.5k
  }
34
1.10M
  return (row_top[x] + row[x - 1] + 1) / 2;
35
1.17M
}
Unexecuted instantiation: entropy_coder.cc:jxl::PredictFromTopAndLeft(int const*, int const*, unsigned long, int)
36
37
static constexpr U32Enc kDCThresholdDist(Bits(4), BitsOffset(8, 16),
38
                                         BitsOffset(16, 272),
39
                                         BitsOffset(32, 65808));
40
41
static constexpr U32Enc kQFThresholdDist(Bits(2), BitsOffset(3, 4),
42
                                         BitsOffset(5, 12), BitsOffset(8, 44));
43
44
Status DecodeBlockCtxMap(JxlMemoryManager* memory_manager, BitReader* br,
45
                         BlockCtxMap* block_ctx_map);
46
47
}  // namespace jxl
48
49
#endif  // LIB_JXL_ENTROPY_CODER_H_