bytestream_put_le16(&out, pixel);
}
break;
+ case EXR_UINT:
+ ptr[0] = in;
+ ptr[1] = ptr[0] + s->xdelta;
+ ptr[2] = ptr[1] + s->xdelta;
+ ptr[3] = ptr[2] + s->xdelta;
+ in = ptr[3] + s->xdelta;
+
+ for (j = 0; j < s->xdelta; ++j) {
+ uint32_t diff = (*(ptr[0]++) << 24) |
+ (*(ptr[1]++) << 16) |
+ (*(ptr[2]++) << 8 ) |
+ (*(ptr[3]++));
+ pixel += diff;
+ bytestream_put_le32(&out, pixel);
+ }
+ break;
default:
return AVERROR_INVALIDDATA;
}
return AVERROR_PATCHWELCOME;
}
- if (s->channel_offsets[channel_index] == -1){/* channel have not been previously assign */
- if (channel_index >= 0) {
- if (s->pixel_type != EXR_UNKNOWN &&
- s->pixel_type != current_pixel_type) {
- av_log(s->avctx, AV_LOG_ERROR,
- "RGB channels not of the same depth.\n");
- return AVERROR_INVALIDDATA;
- }
- s->pixel_type = current_pixel_type;
- s->channel_offsets[channel_index] = s->current_channel_offset;
+ if (channel_index >= 0 && s->channel_offsets[channel_index] == -1) { /* channel has not been previously assigned */
+ if (s->pixel_type != EXR_UNKNOWN &&
+ s->pixel_type != current_pixel_type) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "RGB channels not of the same depth.\n");
+ return AVERROR_INVALIDDATA;
}
+ s->pixel_type = current_pixel_type;
+ s->channel_offsets[channel_index] = s->current_channel_offset;
}
s->channels = av_realloc(s->channels,
channel->xsub = xsub;
channel->ysub = ysub;
- s->current_channel_offset += 1 << current_pixel_type;
+ if (current_pixel_type == EXR_HALF) {
+ s->current_channel_offset += 2;
+ } else {/* Float or UINT32 */
+ s->current_channel_offset += 4;
+ }
}
/* Check if all channels are set with an offset or if the channels