whitespace cosmetics: K&R coding style, prettyprinting
Originally committed as revision 20381 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
bc8964ef20
commit
d3067047e7
@ -18,6 +18,7 @@
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "pnm.h"
|
||||
|
||||
@ -52,7 +53,8 @@ static void pnm_get(PNMContext *sc, char *str, int buf_size)
|
||||
*s = '\0';
|
||||
}
|
||||
|
||||
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s){
|
||||
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
|
||||
{
|
||||
char buf1[32], tuple_type[32];
|
||||
int h, w, depth, maxval;
|
||||
|
||||
|
@ -23,8 +23,7 @@
|
||||
#include "pnm.h"
|
||||
|
||||
|
||||
static int pnm_parse(AVCodecParserContext *s,
|
||||
AVCodecContext *avctx,
|
||||
static int pnm_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
const uint8_t **poutbuf, int *poutbuf_size,
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
|
@ -18,12 +18,14 @@
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "bytestream.h"
|
||||
#include "pnm.h"
|
||||
|
||||
|
||||
static av_cold int common_init(AVCodecContext *avctx){
|
||||
static av_cold int common_init(AVCodecContext *avctx)
|
||||
{
|
||||
PNMContext *s = avctx->priv_data;
|
||||
|
||||
avcodec_get_frame_defaults((AVFrame*)&s->picture);
|
||||
@ -32,9 +34,8 @@ static av_cold int common_init(AVCodecContext *avctx){
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pnm_decode_frame(AVCodecContext *avctx,
|
||||
void *data, int *data_size,
|
||||
AVPacket *avpkt)
|
||||
static int pnm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *data_size, AVPacket *avpkt)
|
||||
{
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
@ -161,7 +162,9 @@ static int pnm_decode_frame(AVCodecContext *avctx,
|
||||
return s->bytestream - s->bytestream_start;
|
||||
}
|
||||
|
||||
static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data){
|
||||
static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
|
||||
int buf_size, void *data)
|
||||
{
|
||||
PNMContext *s = avctx->priv_data;
|
||||
AVFrame *pict = data;
|
||||
AVFrame * const p = (AVFrame*)&s->picture;
|
||||
@ -213,8 +216,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
|
||||
return -1;
|
||||
}
|
||||
snprintf(s->bytestream, s->bytestream_end - s->bytestream,
|
||||
"P%c\n%d %d\n",
|
||||
c, avctx->width, h1);
|
||||
"P%c\n%d %d\n", c, avctx->width, h1);
|
||||
s->bytestream += strlen(s->bytestream);
|
||||
if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {
|
||||
snprintf(s->bytestream, s->bytestream_end - s->bytestream,
|
||||
@ -247,7 +249,9 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
|
||||
return s->bytestream - s->bytestream_start;
|
||||
}
|
||||
|
||||
static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int buf_size, void *data){
|
||||
static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
|
||||
int buf_size, void *data)
|
||||
{
|
||||
PNMContext *s = avctx->priv_data;
|
||||
AVFrame *pict = data;
|
||||
AVFrame * const p = (AVFrame*)&s->picture;
|
||||
@ -328,7 +332,8 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
|
||||
return s->bytestream - s->bytestream_start;
|
||||
}
|
||||
|
||||
static av_cold int common_end(AVCodecContext *avctx){
|
||||
static av_cold int common_end(AVCodecContext *avctx)
|
||||
{
|
||||
PNMContext *s = avctx->priv_data;
|
||||
|
||||
if (s->picture.data[0])
|
||||
@ -365,7 +370,7 @@ AVCodec pgm_encoder = {
|
||||
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
|
||||
};
|
||||
#endif // CONFIG_PGM_ENCODER
|
||||
#endif
|
||||
|
||||
#if CONFIG_PGMYUV_DECODER
|
||||
AVCodec pgmyuv_decoder = {
|
||||
@ -394,7 +399,7 @@ AVCodec pgmyuv_encoder = {
|
||||
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
|
||||
};
|
||||
#endif // CONFIG_PGMYUV_ENCODER
|
||||
#endif
|
||||
|
||||
#if CONFIG_PPM_DECODER
|
||||
AVCodec ppm_decoder = {
|
||||
@ -423,7 +428,7 @@ AVCodec ppm_encoder = {
|
||||
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
|
||||
};
|
||||
#endif // CONFIG_PPM_ENCODER
|
||||
#endif
|
||||
|
||||
#if CONFIG_PBM_DECODER
|
||||
AVCodec pbm_decoder = {
|
||||
@ -452,7 +457,7 @@ AVCodec pbm_encoder = {
|
||||
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
|
||||
};
|
||||
#endif // CONFIG_PBM_ENCODER
|
||||
#endif
|
||||
|
||||
#if CONFIG_PAM_DECODER
|
||||
AVCodec pam_decoder = {
|
||||
@ -481,4 +486,4 @@ AVCodec pam_encoder = {
|
||||
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
|
||||
};
|
||||
#endif // CONFIG_PAM_ENCODER
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user