CLAIMS

1. In an apparatus comprising one or more processors, a method for generating a reshaping function for reshaping an input image in a first codewords representation to a reshaped image in a second codewords representation, the method comprising:

accessing a first set of pre-computed reshaping functions, wherein a pre-computed reshaping function of the first set maps pixel codewords from the first codeword

representation to the second codeword representation and each reshaping function is characterized by a reshaping-index parameter identifying the reshaping function;

receiving an input image in the first codeword representation and a desired reshaping parameter identifying the reshaping function to be generated;

identifying within the first set of pre-computed reshaping functions a first pre computed reshaping function with a first reshaping-index parameter lower than the desired reshaping parameter and a second pre-computed reshaping function with a second reshaping-index parameter higher than the desired reshaping parameter, the desired reshaping parameter being different from any reshaping-index parameters of the pre-computed reshaping functions of the first set;

generating the reshaping function by interpolating the first pre-computed reshaping function and the second pre-computed reshaping function using the desired reshaping parameter;

applying the generated reshaping function to the input image to generate the reshaped image in the second codeword representation; and

coding the reshaped image to generate a coded reshaped image.

2. The method of claim 1, wherein the reshaping-index parameter and the desired reshaping parameter of the respective reshaping functions comprise a device setting of a device for capturing or displaying the input image or the reshaped image.

3. The method of claim 2, wherein the device setting comprises one of: a luminance, a maximum luminance, an exposure time, a picture mode, or a flash mode of the device.

4. The method of any one of claims 1 to 3, wherein the generated reshaped function is a forward reshaping function and the method further comprises:

generating a backward reshaping function based on the forward reshaping function; and

communicating to a decoder the coded reshaped image and the backward reshaping function.

5. The method of any of the previous claims, further comprising:

accessing a second set of pre-computed reshaping functions, wherein a pre-computed reshaping function maps pixel codewords from the second codeword representation to a third codeword representation;

receiving a second desired reshaping parameter being different from any reshaping-index parameter of the reshaping functions of the second set;

identifying within the second set of pre-computed reshaping functions a third pre computed reshaping function with a third reshaping-index parameter lower than the second desired reshaping parameter and a fourth pre-computed reshaping function with a fourth reshaping-index parameter higher than the second desired reshaping parameter;

generating an output backward reshaping function by interpolating the third pre computed reshaping function and the fourth pre-computed reshaping function in the second set of pre-computed reshaping functions and using the second desired reshaping parameter; and

communicating to a decoder the coded reshaped image and the output backward reshaping function.

6. The method of any of the previous claims, wherein generating the reshaping function comprises:

computing an interpolating factor between zero and one, based on the desired reshaping parameter, the first reshaping-index parameter, and the second reshaping-index parameter; and

generating parameters of the output reshaping function by interpolation between corresponding parameters of the first pre-computed reshaping function and the second pre computed reshaping function, wherein the interpolation uses the interpolation factor.

7. The method of claim 6, when computing the interpolating factor comprises computing:

wherein or denotes the interpolating factor, r denotes the desired reshaping parameter,

denotes the first reshaping-index parameter, denotes the second reshaping-index parameter, and

8. The method of claim 6 or claim 7, wherein generating parameters for the output reshaping shaping function comprises computing:

wherein for a forward reshaping function represented using K polynomial segments, where each polynomial segment is represented by an N-th order polynomial, or denotes the interpolation factor, and denote respectively the polynomial

coefficients for the m-th segment in the output forward reshaping function, the first pre computed reshaping function, and the second pre-computed reshaping function.

9. The method of any of claims 6-8, wherein generating parameters for the output reshaping shaping function comprises computing:

wherein or denotes the interpolation factor, and denote respectively

sets of multivariate, multiple-regression coefficients for the output reshaping function, the first pre-computed reshaping function, and the second pre-computed reshaping function.

10. The method of any of the previous claims, wherein the reshaping functions of the first set are pre-computed by:

accessing a database of image pairs representing the same scene in a first signal representation format and a second signal representation format, wherein the first signal representation format is different from the second signal representation format;

generating based on the database of image pairs an output set of reshaping functions larger than the first set of reshaping functions;

interpolating all the reshaping functions in the output set; and

selecting the first set of reshaping functions among the output set of reshaping functions such that an error between interpolated reshaped functions and functions in the first set of reshaping functions is within a threshold.

11. The method of claim 10 wherein the first signal representation format comprises a high-dynamic range representation and the second signal representation format comprises a standard dynamic range representation.

12. The method of claim 10 or 11, wherein the first signal representation format and the second signal representation format comprise one or more of: an Electric-optical Transfer function (EOTF), a bit-depth, a color gamut, a color format, or a color space.

13. The method of any of the previous claims, wherein two or more functions in the first set of pre-computed reshaping functions are represented as multi-segment polynomials and corresponding segments for these two or more functions have same starting and ending pivot points.

14. A method to decode a coded image, the method comprising:

receiving a coded reshaped image in a first codeword representation and a desired reshaping parameter;

decoding the coded reshaped image to generate a first decoded image in the first codeword representation;

accessing a set of pre-computed reshaping functions, wherein a reshaping function maps pixel codewords from the first codeword representation to a second codeword representation and each reshaping function is characterized by a reshaping-index parameter identifying the reshaping function;

identifying within the set of pre-computed reshaping functions a first pre-computed reshaping function with a first reshaping-index parameter lower than the desired reshaping parameter and a second pre-computed reshaping function with a second reshaping-index parameter higher than the desired reshaping parameter, the desired reshaping parameter being different from any reshaping-index parameters of the pre-computed reshaping functions of the first set;

generating an output reshaping function by interpolating the first pre-computed reshaping function and the second pre-computed reshaping function using the desired reshaping parameter; and

applying the output reshaping function to the first decoded image to generate an output image in the second codeword representation.

15. The method of claim 14, wherein generating the output reshaping function comprises: computing an interpolating factor between zero and one based on the desired reshaping parameter, the first reshaping-index parameter, and the second reshaping-index parameter; and

generating parameters of the output reshaping function by interpolation between corresponding parameters of the first pre-computed reshaping function and the second pre computed reshaping function, wherein the interpolation uses the interpolation factor.

16. The method of claim 15, when computing the interpolating factor comprises computing:

wherein or denotes the interpolation factor, r denotes the desired reshaping parameter,

denotes the first reshaping-index parameter,

denotes the second reshaping-index parameter, and

17. A non-transitory computer-readable storage medium having stored thereon computer-executable instructions for executing with one or more processors a method in accordance with any of the claims 1-16.

18. An apparatus comprising a processor and configured to perform any of the methods recited in claims 1-16.