[FFmpeg-devel] [PATCH] Add FITS Encoder
Paras Chadha
paraschadha18 at gmail.com
Sun Jul 16 17:34:36 EEST 2017
On Sun, Jul 16, 2017 at 6:29 PM, Derek Buitenhuis <
derek.buitenhuis at gmail.com> wrote:
> On 7/16/2017 1:31 PM, Paras Chadha wrote:
> > Signed-off-by: Paras Chadha <paraschadha18 at gmail.com>
> > ---
> > doc/general.texi | 2 +
> > libavcodec/Makefile | 1 +
> > libavcodec/allcodecs.c | 1 +
> > libavcodec/fitsenc.c | 238 ++++++++++++++++++++++++++++++
> +++++++++++++++++++
> > libavformat/img2enc.c | 1 +
> > 5 files changed, 243 insertions(+)
> > create mode 100644 libavcodec/fitsenc.c
>
> Why is there no decoder?
>
> Also, missing configure change (?) and version bump.
>
Decoder is in separate patch
>
> > +
> > +static int write_keyword_value(uint8_t **bytestream, const char *
> keyword, int value)
> > +{
> > + int len, ret;
> > + uint8_t * header = * bytestream;
>
> Please don't put spaces between '*' for pointers, it's pretty ambiguous to
> readers.
>
ok
>
> > + len = strlen(keyword);
> > +
> > + memcpy(header, keyword, len);
> > + memset(header + len, ' ', 8 - len);
>
> This sort of stuff makes me unfortable, even if the input is all literals.
> At
> the very least, it should be documented, or checked, or a constant used
> instead
> of a magic 8. Maybe I'm just paranoid.
>
8 is used because it is the maximum size of a header keyword. All the
string literals i am passing in keyword have length less than or equal to 8
and greater than 0. Still, i will add a check that it is executed only when
len > 0 and len <= 8 and use constant instead of 8.
>
> > + data_size = (bitpix >> 3) * avctx->height * avctx->width * naxis3;
>
> That's this based off of?
>
I am sorry, i didn't get the question.
>
> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
More information about the ffmpeg-devel
mailing list