[FFmpeg-devel] [PATCH] OpenEXR decoder rev-2
Jimmy Christensen
jimmy
Wed Jul 1 15:34:19 CEST 2009
On 2009-07-01 15:10, Diego Biurrun wrote:
> On Wed, Jul 01, 2009 at 02:46:54PM +0200, Jimmy Christensen wrote:
>>
>> --- libavcodec/exr.c (revision 0)
>> +++ libavcodec/exr.c (revision 0)
>> @@ -0,0 +1,275 @@
>> +
>> +static inline uint16_t exr_halflt2uint(uint16_t v) {
>
> consistent K&R style for new files please.
>
>> + int xmin = -1;
>> + int xmax = -1;
>> + int ymin = -1;
>> + int ymax = -1;
>> + int xdelta = -1;
>
> align
>
>> + uint8_t red_channel = -1;
>> + uint8_t green_channel = -1;
>> + uint8_t blue_channel = -1;
>
> align
>
>> + if (magic_number != 20000630) { // As per documentation of OpenEXR it's supposed to be int 20000630 little endian
>
> little-endian
>
>> + if (strcmp(variable_buffer_name, "dataWindow") == 0) {
>> + xmin = AV_RL32(buf);
>> + ymin = AV_RL32(buf+4);
>> + xmax = AV_RL32(buf+8);
>> + ymax = AV_RL32(buf+12);
>> + xdelta = (xmax-xmin)+1;
>
> Spaces around + would make this more readable.
>
>> + if (strcmp(variable_buffer_name, "displayWindow") == 0) {
>> +
>> + if (strcmp(variable_buffer_name, "lineOrder") == 0) {
>
> The '== 0' is unnecessary.
Changed all the strcmp to something like this:
if (!strcmp(variable_buffer_name, "lineOrder"))
>
>> + if(*buf != 0) {
>
> similar
I suppose you mean the spaces thing. I would however like to like to
keep the "*buf != 0" part since it makes it a little more descriptive IMHO.
>
>> + switch(bits_per_color_table[bits_per_color_id]) {
>
> switch (
>
>> + switch(bits_per_color_table[bits_per_color_id]) {
>
> ditto
>
>> + // Zero out the end if ymax+1 is not h
>> + for(y = ymax; y< avctx->height; y++) {
>
> for (
>
> The rest looks OK from my side.
>
All the K&R related stuff should be fixed now. Well it went better than
my first initial submission :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenEXR-rev2.diff
Type: text/x-patch
Size: 12293 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090701/386079a3/attachment.bin>
More information about the ffmpeg-devel
mailing list