A method of assigning bitrates to base layers and enhancement layers in a dual codec, the method comprising: scanning a scene of a video for bright and dark areas and accumulating feature data of the scene in a feature bin accumulator, and determining feature values of one or more features of the scene from values in the feature bin accumulator, wherein the accumulating comprises accumulating feature values into a plurality of bins, and wherein each bin of the plurality of bins corresponds to a range of luminance values; calculating an alpha value based on the bright and dark areas, wherein the alpha value is the exponent of a formula for forward reshaping of a luminance channel of the video; decomposing the scene into a base layer and at least one enhancement layer, wherein said decomposing involves determining a separation value of luminance based on the formula for forward reshaping, and wherein the base layer and the at least one enhancement layer are separated at the separation value of luminance with pixels with luminance values below the separation value of luminance being assigned to the base layer, and pixels with luminance values above the separation value of luminance being assigned to the at least one enhancement layer, and wherein the features are separated into base layer and enhancement layer features according to the separation by the separation value of luminance, wherein at least one feature is a ratio of standard deviation in one of the at least one enhancement layer to a channel standard deviation in the base layer for a channel, and the feature values comprise a ratio of standard deviation in one of the at least one enhancement layer to a channel standard deviation in the base layer for the channel; determining a bitrate class for all of the base layer and the at least one enhancement layer by processing the feature values of the one or more features of the scene against a machine learning model; and setting the bitrates of the base layer and the at least one enhancement layer based on the determined bitrate class, wherein the processing of the feature values of the one or more features against the machine learning model comprises: mapping the feature values of the one or more features into N dimensional space where N is the number of the one or more features; and determining where the mapped feature values are located in the N dimensional space compared to predetermined hyperplanes of the N dimensional space. scanning a scene of a video for bright and dark areas and accumulating feature data of the scene in a feature bin accumulator, and determining feature values of one or more features of the scene from values in the feature bin accumulator, wherein the accumulating comprises accumulating feature values into a plurality of bins, and wherein each bin of the plurality of bins corresponds to a range of luminance values; calculating an alpha value based on the bright and dark areas, wherein the alpha value is the exponent of a formula for forward reshaping of a luminance channel of the video; decomposing the scene into a base layer and at least one enhancement layer, wherein said decomposing involves determining a separation value of luminance based on the formula for forward reshaping, and wherein the base layer and the at least one enhancement layer are separated at the separation value of luminance with pixels with luminance values below the separation value of luminance being assigned to the base layer, and pixels with luminance values above the separation value of luminance being assigned to the at least one enhancement layer, and wherein the features are separated into base layer and enhancement layer features according to the separation by the separation value of luminance, wherein at least one feature is a ratio of standard deviation in one of the at least one enhancement layer to a channel standard deviation in the base layer for a channel, and the feature values comprise a ratio of standard deviation in one of the at least one enhancement layer to a channel standard deviation in the base layer for the channel; determining a bitrate class for all of the base layer and the at least one enhancement layer by processing the feature values of the one or more features of the scene against a machine learning model; and setting the bitrates of the base layer and the at least one enhancement layer based on the determined bitrate class, wherein the processing of the feature values of the one or more features against the machine learning model comprises: mapping the feature values of the one or more features into N dimensional space where N is the number of the one or more features; and determining where the mapped feature values are located in the N dimensional space compared to predetermined hyperplanes of the N dimensional space. mapping the feature values of the one or more features into N dimensional space where N is the number of the one or more features; and determining where the mapped feature values are located in the N dimensional space compared to predetermined hyperplanes of the N dimensional space.