Merge commit '9752d07d33d5370f7819865fbb5e582b982aad06'

* commit '9752d07d33d5370f7819865fbb5e582b982aad06':
  dirac: K&R formatting cosmetics

Conflicts:
	libavcodec/dirac.c
	libavcodec/dirac_parser.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/88/head
Michael Niedermayer 11 years ago
commit b63052839a
  1. 8
      libavcodec/dirac.c
  2. 16
      libavcodec/dirac_parser.c

@ -27,8 +27,9 @@
*/
#include "libavutil/imgutils.h"
#include "dirac.h"
#include "avcodec.h"
#include "dirac.h"
#include "golomb.h"
#include "internal.h"
#include "mpeg12data.h"
@ -44,6 +45,7 @@ static const dirac_source_params dirac_source_parameters_defaults[] = {
{ 704, 576, 2, 0, 1, 10, 3, 704, 576, 0, 0, 1, 2 },
{ 720, 480, 1, 1, 0, 4, 2, 704, 480, 8, 0, 3, 1 },
{ 720, 576, 1, 1, 1, 3, 3, 704, 576, 8, 0, 3, 2 },
{ 1280, 720, 1, 0, 1, 7, 1, 1280, 720, 0, 0, 3, 3 },
{ 1280, 720, 1, 0, 1, 6, 1, 1280, 720, 0, 0, 3, 3 },
{ 1920, 1080, 1, 1, 1, 4, 1, 1920, 1080, 0, 0, 3, 3 },
@ -52,6 +54,7 @@ static const dirac_source_params dirac_source_parameters_defaults[] = {
{ 1920, 1080, 1, 0, 1, 6, 1, 1920, 1080, 0, 0, 3, 3 },
{ 2048, 1080, 0, 0, 1, 2, 1, 2048, 1080, 0, 0, 4, 4 },
{ 4096, 2160, 0, 0, 1, 2, 1, 4096, 2160, 0, 0, 4, 4 },
{ 3840, 2160, 1, 0, 1, 7, 1, 3840, 2160, 0, 0, 3, 3 },
{ 3840, 2160, 1, 0, 1, 6, 1, 3840, 2160, 0, 0, 3, 3 },
{ 7680, 4320, 1, 0, 1, 7, 1, 3840, 2160, 0, 0, 3, 3 },
@ -222,7 +225,8 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
luma_depth = av_log2(svq3_get_ue_golomb(gb)) + 1;
svq3_get_ue_golomb(gb); /* chroma offset */
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

@ -31,6 +31,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "parser.h"
#define DIRAC_PARSE_INFO_PREFIX 0x42424344
@ -90,8 +91,7 @@ static int find_frame_end(DiracParseContext *pc,
return -1;
}
typedef struct DiracParseUnit
{
typedef struct DiracParseUnit {
int next_pu_offset;
int prev_pu_offset;
uint8_t pu_type;
@ -136,9 +136,9 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
if (next == -1) {
/* Found a possible frame start but not a frame end */
void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
pc->index + (*buf_size -
pc->sync_offset));
void *new_buffer =
av_fast_realloc(pc->buffer, &pc->buffer_size,
pc->index + (*buf_size - pc->sync_offset));
pc->buffer = new_buffer;
memcpy(pc->buffer + pc->index, (*buf + pc->sync_offset),
*buf_size - pc->sync_offset);
@ -229,15 +229,13 @@ static int dirac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
/* Assume that data has been packetized into an encapsulation unit. */
} else {
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. */
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;
}
}
*poutbuf = buf;
*poutbuf_size = buf_size;

Loading…
Cancel
Save