mirror of https://github.com/FFmpeg/FFmpeg.git
Compare commits
5 Commits
43abd1ced9
...
3cc1dc3358
| Author | SHA1 | Date |
|---|---|---|
|
|
3cc1dc3358 | |
|
|
775b102182 | |
|
|
191f7e4869 | |
|
|
06b3a20761 | |
|
|
30d66be21a |
|
|
@ -76,7 +76,9 @@ typedef struct OGGPageList {
|
|||
typedef struct OGGContext {
|
||||
const AVClass *class;
|
||||
OGGPageList *page_list;
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 63
|
||||
int pref_size; ///< preferred page size (0 => fill all segments)
|
||||
#endif
|
||||
int64_t pref_duration; ///< preferred page duration (0 => fill all segments)
|
||||
int serial_offset;
|
||||
} OGGContext;
|
||||
|
|
@ -87,10 +89,12 @@ typedef struct OGGContext {
|
|||
static const AVOption options[] = {
|
||||
{ "serial_offset", "serial number offset",
|
||||
OFFSET(serial_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, PARAM },
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 63
|
||||
{ "oggpagesize", "Set preferred Ogg page size.",
|
||||
OFFSET(pref_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, MAX_PAGE_SIZE, PARAM},
|
||||
{ "pagesize", "preferred page size in bytes (deprecated)",
|
||||
OFFSET(pref_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_PAGE_SIZE, PARAM },
|
||||
OFFSET(pref_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, MAX_PAGE_SIZE, PARAM | AV_OPT_FLAG_DEPRECATED },
|
||||
{ "pagesize", "preferred page size in bytes",
|
||||
OFFSET(pref_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_PAGE_SIZE, PARAM | AV_OPT_FLAG_DEPRECATED },
|
||||
#endif
|
||||
{ "page_duration", "preferred page duration, in microseconds",
|
||||
OFFSET(pref_duration), AV_OPT_TYPE_INT64, { .i64 = 1000000 }, 0, INT64_MAX, PARAM },
|
||||
{ NULL },
|
||||
|
|
@ -262,8 +266,12 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
|
|||
if (page->segments_count == 255) {
|
||||
ogg_buffer_page(s, oggstream);
|
||||
} else if (!header) {
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 63
|
||||
if ((ogg->pref_size > 0 && page->size >= ogg->pref_size) ||
|
||||
(ogg->pref_duration > 0 && next - start >= ogg->pref_duration)) {
|
||||
#else
|
||||
if (ogg->pref_duration > 0 && next - start >= ogg->pref_duration) {
|
||||
#endif
|
||||
ogg_buffer_page(s, oggstream);
|
||||
}
|
||||
}
|
||||
|
|
@ -477,9 +485,6 @@ static int ogg_init(AVFormatContext *s)
|
|||
OGGStreamContext *oggstream = NULL;
|
||||
int i, j;
|
||||
|
||||
if (ogg->pref_size)
|
||||
av_log(s, AV_LOG_WARNING, "The pagesize option is deprecated\n");
|
||||
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
unsigned serial_num = i + ogg->serial_offset;
|
||||
|
|
|
|||
|
|
@ -93,21 +93,6 @@ bool ff_sws_pixel_type_is_int(SwsPixelType type)
|
|||
return false;
|
||||
}
|
||||
|
||||
SwsPixelType ff_sws_pixel_type_to_uint(SwsPixelType type)
|
||||
{
|
||||
if (!type)
|
||||
return type;
|
||||
|
||||
switch (ff_sws_pixel_type_size(type)) {
|
||||
case 8: return SWS_PIXEL_U8;
|
||||
case 16: return SWS_PIXEL_U16;
|
||||
case 32: return SWS_PIXEL_U32;
|
||||
}
|
||||
|
||||
av_unreachable("Invalid pixel type!");
|
||||
return SWS_PIXEL_NONE;
|
||||
}
|
||||
|
||||
/* biased towards `a` */
|
||||
static AVRational av_min_q(AVRational a, AVRational b)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ typedef enum SwsPixelType {
|
|||
const char *ff_sws_pixel_type_name(SwsPixelType type);
|
||||
int ff_sws_pixel_type_size(SwsPixelType type) av_const;
|
||||
bool ff_sws_pixel_type_is_int(SwsPixelType type) av_const;
|
||||
SwsPixelType ff_sws_pixel_type_to_uint(SwsPixelType type) av_const;
|
||||
|
||||
typedef enum SwsOpType {
|
||||
SWS_OP_INVALID = 0,
|
||||
|
|
|
|||
|
|
@ -287,10 +287,10 @@ DECL_PATTERN(expand32)
|
|||
|
||||
SWS_LOOP
|
||||
for (int i = 0; i < SWS_BLOCK_SIZE; i++) {
|
||||
x32[i] = x[i] << 24 | x[i] << 16 | x[i] << 8 | x[i];
|
||||
y32[i] = y[i] << 24 | y[i] << 16 | y[i] << 8 | y[i];
|
||||
z32[i] = z[i] << 24 | z[i] << 16 | z[i] << 8 | z[i];
|
||||
w32[i] = w[i] << 24 | w[i] << 16 | w[i] << 8 | w[i];
|
||||
x32[i] = (uint32_t)x[i] << 24 | x[i] << 16 | x[i] << 8 | x[i];
|
||||
y32[i] = (uint32_t)y[i] << 24 | y[i] << 16 | y[i] << 8 | y[i];
|
||||
z32[i] = (uint32_t)z[i] << 24 | z[i] << 16 | z[i] << 8 | z[i];
|
||||
w32[i] = (uint32_t)w[i] << 24 | w[i] << 16 | w[i] << 8 | w[i];
|
||||
}
|
||||
|
||||
CONTINUE(u32block_t, x32, y32, z32, w32);
|
||||
|
|
|
|||
|
|
@ -616,8 +616,8 @@ static void normalize_clear(SwsOp *op)
|
|||
if (!op->c.q4[i].den)
|
||||
continue;
|
||||
switch (ff_sws_pixel_type_size(op->type)) {
|
||||
case 1: c.u32 = 0x1010101 * priv.u8[i]; break;
|
||||
case 2: c.u32 = priv.u16[i] << 16 | priv.u16[i]; break;
|
||||
case 1: c.u32 = 0x1010101U * priv.u8[i]; break;
|
||||
case 2: c.u32 = (uint32_t)priv.u16[i] << 16 | priv.u16[i]; break;
|
||||
case 4: c.u32 = priv.u32[i]; break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ static AVRational rndq(SwsPixelType t)
|
|||
{
|
||||
const unsigned num = rnd();
|
||||
if (ff_sws_pixel_type_is_int(t)) {
|
||||
const unsigned mask = (1 << (ff_sws_pixel_type_size(t) * 8)) - 1;
|
||||
const unsigned mask = UINT_MAX >> (32 - ff_sws_pixel_type_size(t) * 8);
|
||||
return (AVRational) { num & mask, 1 };
|
||||
} else {
|
||||
const unsigned den = rnd();
|
||||
|
|
@ -588,7 +588,7 @@ static void check_convert(void)
|
|||
.convert.to = o,
|
||||
});
|
||||
} else if (isize > osize || !ff_sws_pixel_type_is_int(i)) {
|
||||
uint32_t range = (1 << osize * 8) - 1;
|
||||
uint32_t range = UINT32_MAX >> (32 - osize * 8);
|
||||
CHECK_COMMON_RANGE(name, range, i, o, {
|
||||
.op = SWS_OP_CONVERT,
|
||||
.type = i,
|
||||
|
|
|
|||
Loading…
Reference in New Issue