Devices, systems and methods for lossless coding for visual media coding are described. An exemplary method for video processing includes determining, at a sub-block level of a current video block comprising multiple sub-blocks, whether a coding mode is enabled for representing a corresponding sub-block in a bitstream representation, where, for a given sub-block with the coding mode enabled, the given sub-block is represented in the coded representation without applying a forward transform or the given sub-block is reconstructed from the coded representation without applying an inverse transform, and performing, based on the determining, a conversion between the current video block of a video and the bitstream representation of the video.