mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2025-02-13 08:34:47 +00:00
pixdesc: cosmetics
This commit is contained in:
parent
cc86bd4ccc
commit
a684267076
@ -26,8 +26,10 @@
|
|||||||
|
|
||||||
#include "intreadwrite.h"
|
#include "intreadwrite.h"
|
||||||
|
|
||||||
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
|
void av_read_image_line(uint16_t *dst,
|
||||||
const AVPixFmtDescriptor *desc, int x, int y, int c, int w,
|
const uint8_t *data[4], const int linesize[4],
|
||||||
|
const AVPixFmtDescriptor *desc,
|
||||||
|
int x, int y, int c, int w,
|
||||||
int read_pal_component)
|
int read_pal_component)
|
||||||
{
|
{
|
||||||
AVComponentDescriptor comp = desc->comp[c];
|
AVComponentDescriptor comp = desc->comp[c];
|
||||||
@ -53,7 +55,8 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesiz
|
|||||||
*dst++ = val;
|
*dst++ = val;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const uint8_t *p = data[plane] + y * linesize[plane] + x * step + comp.offset_plus1 - 1;
|
const uint8_t *p = data[plane] + y * linesize[plane] +
|
||||||
|
x * step + comp.offset_plus1 - 1;
|
||||||
int is_8bit = shift + depth <= 8;
|
int is_8bit = shift + depth <= 8;
|
||||||
|
|
||||||
if (is_8bit)
|
if (is_8bit)
|
||||||
@ -71,8 +74,10 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesiz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
|
void av_write_image_line(const uint16_t *src,
|
||||||
const AVPixFmtDescriptor *desc, int x, int y, int c, int w)
|
uint8_t *data[4], const int linesize[4],
|
||||||
|
const AVPixFmtDescriptor *desc,
|
||||||
|
int x, int y, int c, int w)
|
||||||
{
|
{
|
||||||
AVComponentDescriptor comp = desc->comp[c];
|
AVComponentDescriptor comp = desc->comp[c];
|
||||||
int plane = comp.plane;
|
int plane = comp.plane;
|
||||||
@ -93,7 +98,8 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int shift = comp.shift;
|
int shift = comp.shift;
|
||||||
uint8_t *p = data[plane] + y * linesize[plane] + x * step + comp.offset_plus1 - 1;
|
uint8_t *p = data[plane] + y * linesize[plane] +
|
||||||
|
x * step + comp.offset_plus1 - 1;
|
||||||
|
|
||||||
if (shift + depth <= 8) {
|
if (shift + depth <= 8) {
|
||||||
p += !!(flags & PIX_FMT_BE);
|
p += !!(flags & PIX_FMT_BE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user