mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
dirac: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
parent
1ec335513f
commit
9752d07d33
@ -26,8 +26,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
#include "dirac.h"
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
#include "dirac.h"
|
||||||
#include "golomb.h"
|
#include "golomb.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "mpeg12data.h"
|
#include "mpeg12data.h"
|
||||||
@ -222,7 +223,8 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
|||||||
luma_depth = av_log2(svq3_get_ue_golomb(gb)) + 1;
|
luma_depth = av_log2(svq3_get_ue_golomb(gb)) + 1;
|
||||||
svq3_get_ue_golomb(gb); /* chroma offset */
|
svq3_get_ue_golomb(gb); /* chroma offset */
|
||||||
svq3_get_ue_golomb(gb); /* chroma excursion */
|
svq3_get_ue_golomb(gb); /* chroma excursion */
|
||||||
avctx->color_range = luma_offset ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
avctx->color_range = luma_offset ? AVCOL_RANGE_MPEG
|
||||||
|
: AVCOL_RANGE_JPEG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* [DIRAC_STD] Table 10.5
|
/* [DIRAC_STD] Table 10.5
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
|
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
|
||||||
#define DIRAC_PARSE_INFO_PREFIX 0x42424344
|
#define DIRAC_PARSE_INFO_PREFIX 0x42424344
|
||||||
@ -90,8 +91,7 @@ static int find_frame_end(DiracParseContext *pc,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct DiracParseUnit
|
typedef struct DiracParseUnit {
|
||||||
{
|
|
||||||
int next_pu_offset;
|
int next_pu_offset;
|
||||||
int prev_pu_offset;
|
int prev_pu_offset;
|
||||||
uint8_t pu_type;
|
uint8_t pu_type;
|
||||||
@ -136,9 +136,9 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
|
|||||||
|
|
||||||
if (next == -1) {
|
if (next == -1) {
|
||||||
/* Found a possible frame start but not a frame end */
|
/* Found a possible frame start but not a frame end */
|
||||||
void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
|
void *new_buffer =
|
||||||
pc->index + (*buf_size -
|
av_fast_realloc(pc->buffer, &pc->buffer_size,
|
||||||
pc->sync_offset));
|
pc->index + (*buf_size - pc->sync_offset));
|
||||||
pc->buffer = new_buffer;
|
pc->buffer = new_buffer;
|
||||||
memcpy(pc->buffer + pc->index, (*buf + pc->sync_offset),
|
memcpy(pc->buffer + pc->index, (*buf + pc->sync_offset),
|
||||||
*buf_size - pc->sync_offset);
|
*buf_size - pc->sync_offset);
|
||||||
@ -227,15 +227,13 @@ static int dirac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
|||||||
/* Assume that data has been packetized into an encapsulation unit. */
|
/* Assume that data has been packetized into an encapsulation unit. */
|
||||||
} else {
|
} else {
|
||||||
next = find_frame_end(pc, buf, buf_size);
|
next = find_frame_end(pc, buf, buf_size);
|
||||||
if (!pc->is_synced && next == -1) {
|
if (!pc->is_synced && next == -1)
|
||||||
/* No frame start found yet. So throw away the entire buffer. */
|
/* No frame start found yet. So throw away the entire buffer. */
|
||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
|
||||||
|
|
||||||
if (dirac_combine_frame(s, avctx, next, &buf, &buf_size) < 0) {
|
if (dirac_combine_frame(s, avctx, next, &buf, &buf_size) < 0)
|
||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
*poutbuf = buf;
|
*poutbuf = buf;
|
||||||
*poutbuf_size = buf_size;
|
*poutbuf_size = buf_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user