Skip to content

Remove dead code and empty placeholder files; move selftest out of the CLI binary #30

Description

@audexdev

Summary

Several dead or placeholder artifacts remain in the tree: an unused (and non-deterministic) Rice helper, a stored-but-ignored constructor parameter, empty .cpp/.hpp placeholder files, and a correctness self-test compiled into the production CLI binary. These mislead readers about what is load-bearing.

Affected areas

  • src/codec/rice/rice.cpp / src/codec/rice/rice.hpp
  • src/codec/block/encoder.hpp / src/codec/block/encoder.cpp
  • src/utils/logger.cpp, src/utils/endian.hpp, src/codec/bitstream/bit_reader.cpp
  • src/main.cpp

Problem details

  • Rice::compute_k is dead code. It is declared (rice.hpp:39) and defined (rice.cpp:51-68) but never called from src/ (only the header/definition exist; tests do not use it). It also uses a double-based estimate (1u<<k) < (uint32_t)(mean+0.5) that differs from the live integer adapt_k, so it is both unused and a cross-compiler non-determinism trap if revived.
  • Block::Encoder::order member is effectively dead. The constructor takes and stores order (encoder.hpp:22, encoder.cpp:17), but encode recomputes the order from candidates and never reads this->order; LAC::Encoder passes 12, which is ignored. A parameter that looks load-bearing but is not is a maintenance trap.
  • Empty placeholder files. utils/logger.cpp (0 bytes), utils/endian.hpp (0 bytes), and codec/bitstream/bit_reader.cpp (1 line) imply implementations that were never written.
  • Self-test embedded in the production binary. lac_cli selftest (main.cpp:794-867) is a correctness round-trip test living in the CLI, not the test suite, and it does not cover per-block stereo (mode 2) or mono.

Acceptance criteria

  • Rice::compute_k is removed (or, if a use is intended, documented and made consistent with adapt_k).
  • The unused Block::Encoder order parameter/member is removed or actually used.
  • Empty placeholder files are removed, or filled with their intended content and a reason to exist.
  • The self-test is moved into the test suite (or kept but expanded to cover per-block stereo and mono, with a documented rationale for shipping it in the CLI).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions