diff mbox series

[FFmpeg-devel,11/18] lavc/dv: rename constants to follow our naming conventions

Message ID 20220824084318.333-11-anton@khirnov.net
State Accepted
Commit f7b3fc4afe6540506257c73a93a3f4272c250d44
Headers show
Series [FFmpeg-devel,01/18] tests/fate/mov: add a test for dv audio demuxed through dv demuxer | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Anton Khirnov Aug. 24, 2022, 8:43 a.m. UTC
CamelCase for enum tags, ALL_CAPS for enum values.
---
 libavcodec/dv.h     | 38 +++++++++++++++++++-------------------
 libavcodec/dvdec.c  |  4 ++--
 libavcodec/dvenc.c  | 32 ++++++++++++++++----------------
 libavformat/dv.c    | 18 +++++++++---------
 libavformat/dvenc.c | 34 +++++++++++++++++-----------------
 5 files changed, 63 insertions(+), 63 deletions(-)

Comments

Andreas Rheinhardt Aug. 24, 2022, 12:38 p.m. UTC | #1
Anton Khirnov:
> CamelCase for enum tags, ALL_CAPS for enum values.
> ---
>  libavcodec/dv.h     | 38 +++++++++++++++++++-------------------
>  libavcodec/dvdec.c  |  4 ++--
>  libavcodec/dvenc.c  | 32 ++++++++++++++++----------------
>  libavformat/dv.c    | 18 +++++++++---------
>  libavformat/dvenc.c | 34 +++++++++++++++++-----------------
>  5 files changed, 63 insertions(+), 63 deletions(-)
> 
> diff --git a/libavcodec/dv.h b/libavcodec/dv.h
> index 535f01cf0b..29f97b6089 100644
> --- a/libavcodec/dv.h
> +++ b/libavcodec/dv.h
> @@ -27,27 +27,27 @@
>  #ifndef AVCODEC_DV_H
>  #define AVCODEC_DV_H
>  
> -enum dv_section_type {
> -    dv_sect_header  = 0x1f,
> -    dv_sect_subcode = 0x3f,
> -    dv_sect_vaux    = 0x56,
> -    dv_sect_audio   = 0x76,
> -    dv_sect_video   = 0x96,
> +enum DVSectionType {
> +    DV_SECT_HEADER  = 0x1f,
> +    DV_SECT_SUBCODE = 0x3f,
> +    DV_SECT_VAUX    = 0x56,
> +    DV_SECT_AUDIO   = 0x76,
> +    DV_SECT_VIDEO   = 0x96,
>  };
>  
> -enum dv_pack_type {
> -    dv_header525     = 0x3f,  /* see dv_write_pack for important details on */
> -    dv_header625     = 0xbf,  /* these two packs */
> -    dv_timecode      = 0x13,
> -    dv_audio_source  = 0x50,
> -    dv_audio_control = 0x51,
> -    dv_audio_recdate = 0x52,
> -    dv_audio_rectime = 0x53,
> -    dv_video_source  = 0x60,
> -    dv_video_control = 0x61,
> -    dv_video_recdate = 0x62,
> -    dv_video_rectime = 0x63,
> -    dv_unknown_pack  = 0xff,
> +enum DVPackType {
> +    DV_HEADER525     = 0x3f,  /* see dv_write_pack for important details on */
> +    DV_HEADER625     = 0xbf,  /* these two packs */
> +    DV_TIMECODE      = 0x13,
> +    DV_AUDIO_SOURCE  = 0x50,
> +    DV_AUDIO_CONTROL = 0x51,
> +    DV_AUDIO_RECDATE = 0x52,
> +    DV_AUDIO_RECTIME = 0x53,
> +    DV_VIDEO_SOURCE  = 0x60,
> +    DV_VIDEO_CONTROL = 0x61,
> +    DV_VIDEO_RECDATE = 0x62,
> +    DV_VIDEO_RECTIME = 0x63,
> +    DV_UNKNOWN_PACK  = 0xff,
>  };
>  
>  #define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10)
> diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
> index 297bf7f2fb..424aa79f35 100644
> --- a/libavcodec/dvdec.c
> +++ b/libavcodec/dvdec.c
> @@ -662,7 +662,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
>  
>      /* Determine the codec's sample_aspect ratio from the packet */
>      vsc_pack = buf + 80 * 5 + 48 + 5;
> -    if (*vsc_pack == dv_video_control) {
> +    if (*vsc_pack == DV_VIDEO_CONTROL) {
>          apt    = buf[4] & 0x07;
>          is16_9 = (vsc_pack[2] & 0x07) == 0x02 ||
>                   (!apt && (vsc_pack[2] & 0x07) == 0x07);
> @@ -673,7 +673,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
>          return ret;
>  
>      /* Determine the codec's field order from the packet */
> -    if ( *vsc_pack == dv_video_control ) {
> +    if ( *vsc_pack == DV_VIDEO_CONTROL ) {
>          if (avctx->height == 720) {
>              frame->interlaced_frame = 0;
>              frame->top_field_first = 0;
> diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
> index 1f0374b865..c0ae4c040a 100644
> --- a/libavcodec/dvenc.c
> +++ b/libavcodec/dvenc.c
> @@ -1013,7 +1013,7 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
>      return 0;
>  }
>  
> -static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
> +static inline int dv_write_pack(enum DVPackType pack_id, DVEncContext *c,
>                                  uint8_t *buf)
>  {
>      /*
> @@ -1051,8 +1051,8 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
>  
>      buf[0] = (uint8_t) pack_id;
>      switch (pack_id) {
> -    case dv_header525: /* I can't imagine why these two weren't defined as real */
> -    case dv_header625: /* packs in SMPTE314M -- they definitely look like ones */
> +    case DV_HEADER525: /* I can't imagine why these two weren't defined as real */
> +    case DV_HEADER625: /* packs in SMPTE314M -- they definitely look like ones */
>          buf[1] =  0xf8       | /* reserved -- always 1 */
>                   (apt & 0x07); /* APT: Track application ID */
>          buf[2] = (0    << 7) | /* TF1: audio data is 0 - valid; 1 - invalid */
> @@ -1065,7 +1065,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
>                   (0x0f << 3) | /* reserved -- always 1 */
>                   (apt & 0x07); /* AP3: Subcode application ID */
>          break;
> -    case dv_video_source:
> +    case DV_VIDEO_SOURCE:
>          buf[1] = 0xff;         /* reserved -- always 1 */
>          buf[2] = (1 << 7) |    /* B/W: 0 - b/w, 1 - color */
>                   (1 << 6) |    /* following CLF is valid - 0, invalid - 1 */
> @@ -1076,7 +1076,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
>                   c->sys->video_stype; /* signal type video compression */
>          buf[4] = 0xff;         /* VISC: 0xff -- no information */
>          break;
> -    case dv_video_control:
> +    case DV_VIDEO_CONTROL:
>          buf[1] = (0 << 6) |    /* Copy generation management (CGMS) 0 -- free */
>                   0x3f;         /* reserved -- always 1 */
>          buf[2] = 0xc8 |        /* reserved -- always b11001xxx */
> @@ -1097,7 +1097,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
>      return 5;
>  }
>  
> -static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num,
> +static inline int dv_write_dif_id(enum DVSectionType t, uint8_t chan_num,
>                                    uint8_t seq_num, uint8_t dif_num,
>                                    uint8_t *buf)
>  {
> @@ -1144,14 +1144,14 @@ static void dv_format_frame(DVEncContext *c, uint8_t *buf)
>              memset(buf, 0xff, 80 * 6); /* first 6 DIF blocks are for control data */
>  
>              /* DV header: 1DIF */
> -            buf += dv_write_dif_id(dv_sect_header, chan+chan_offset, i, 0, buf);
> -            buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525),
> +            buf += dv_write_dif_id(DV_SECT_HEADER, chan+chan_offset, i, 0, buf);
> +            buf += dv_write_pack((c->sys->dsf ? DV_HEADER625 : DV_HEADER525),
>                                   c, buf);
>              buf += 72; /* unused bytes */
>  
>              /* DV subcode: 2DIFs */
>              for (j = 0; j < 2; j++) {
> -                buf += dv_write_dif_id(dv_sect_subcode, chan+chan_offset, i, j, buf);
> +                buf += dv_write_dif_id(DV_SECT_SUBCODE, chan+chan_offset, i, j, buf);
>                  for (k = 0; k < 6; k++)
>                      buf += dv_write_ssyb_id(k, (i < c->sys->difseg_size / 2), buf) + 5;
>                  buf += 29; /* unused bytes */
> @@ -1159,12 +1159,12 @@ static void dv_format_frame(DVEncContext *c, uint8_t *buf)
>  
>              /* DV VAUX: 3DIFS */
>              for (j = 0; j < 3; j++) {
> -                buf += dv_write_dif_id(dv_sect_vaux, chan+chan_offset, i, j, buf);
> -                buf += dv_write_pack(dv_video_source,  c, buf);
> -                buf += dv_write_pack(dv_video_control, c, buf);
> +                buf += dv_write_dif_id(DV_SECT_VAUX, chan+chan_offset, i, j, buf);
> +                buf += dv_write_pack(DV_VIDEO_SOURCE,  c, buf);
> +                buf += dv_write_pack(DV_VIDEO_CONTROL, c, buf);
>                  buf += 7 * 5;
> -                buf += dv_write_pack(dv_video_source,  c, buf);
> -                buf += dv_write_pack(dv_video_control, c, buf);
> +                buf += dv_write_pack(DV_VIDEO_SOURCE,  c, buf);
> +                buf += dv_write_pack(DV_VIDEO_CONTROL, c, buf);
>                  buf += 4 * 5 + 2; /* unused bytes */
>              }
>  
> @@ -1172,10 +1172,10 @@ static void dv_format_frame(DVEncContext *c, uint8_t *buf)
>              for (j = 0; j < 135; j++) {
>                  if (j % 15 == 0) {
>                      memset(buf, 0xff, 80);
> -                    buf += dv_write_dif_id(dv_sect_audio, chan+chan_offset, i, j/15, buf);
> +                    buf += dv_write_dif_id(DV_SECT_AUDIO, chan+chan_offset, i, j/15, buf);
>                      buf += 77; /* audio control & shuffled PCM audio */
>                  }
> -                buf += dv_write_dif_id(dv_sect_video, chan+chan_offset, i, j, buf);
> +                buf += dv_write_dif_id(DV_SECT_VIDEO, chan+chan_offset, i, j, buf);
>                  buf += 77; /* 1 video macroblock: 1 bytes control
>                              * 4 * 14 bytes Y 8x8 data
>                              * 10 bytes Cr 8x8 data
> diff --git a/libavformat/dv.c b/libavformat/dv.c
> index 24bacd5c53..303cecf9bb 100644
> --- a/libavformat/dv.c
> +++ b/libavformat/dv.c
> @@ -87,26 +87,26 @@ static inline uint16_t dv_audio_12to16(uint16_t sample)
>      return result;
>  }
>  
> -static const uint8_t *dv_extract_pack(const uint8_t *frame, enum dv_pack_type t)
> +static const uint8_t *dv_extract_pack(const uint8_t *frame, enum DVPackType t)
>  {
>      int offs;
>      int c;
>  
>      for (c = 0; c < 10; c++) {
>          switch (t) {
> -        case dv_audio_source:
> +        case DV_AUDIO_SOURCE:
>              if (c&1)    offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000);
>              else        offs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000);
>              break;
> -        case dv_audio_control:
> +        case DV_AUDIO_CONTROL:
>              if (c&1)    offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000);
>              else        offs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000);
>              break;
> -        case dv_video_control:
> +        case DV_VIDEO_CONTROL:
>              if (c&1)    offs = (80 * 3 + 8      + c*12000);
>              else        offs = (80 * 5 + 48 + 5 + c*12000);
>              break;
> -        case dv_timecode:
> +        case DV_TIMECODE:
>              offs = (80*1 + 3 + 3);
>              break;
>          default:
> @@ -139,7 +139,7 @@ static int dv_extract_audio(const uint8_t *frame, uint8_t **ppcm,
>      const uint8_t *as_pack;
>      uint8_t *pcm, ipcm;
>  
> -    as_pack = dv_extract_pack(frame, dv_audio_source);
> +    as_pack = dv_extract_pack(frame, DV_AUDIO_SOURCE);
>      if (!as_pack)    /* No audio ? */
>          return 0;
>  
> @@ -239,7 +239,7 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame)
>      const uint8_t *as_pack;
>      int freq, stype, smpls, quant, i, ach;
>  
> -    as_pack = dv_extract_pack(frame, dv_audio_source);
> +    as_pack = dv_extract_pack(frame, DV_AUDIO_SOURCE);
>      if (!as_pack || !c->sys) {    /* No audio ? */
>          c->ach = 0;
>          return 0;
> @@ -308,7 +308,7 @@ static int dv_extract_video_info(DVDemuxContext *c, const uint8_t *frame)
>      c->vst->avg_frame_rate = av_inv_q(c->vst->time_base);
>  
>      /* finding out SAR is a little bit messy */
> -    vsc_pack = dv_extract_pack(frame, dv_video_control);
> +    vsc_pack = dv_extract_pack(frame, DV_VIDEO_CONTROL);
>      apt      = frame[4] & 0x07;
>      is16_9   = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
>                               (!apt && (vsc_pack[2] & 0x07) == 0x07)));
> @@ -328,7 +328,7 @@ static int dv_extract_timecode(DVDemuxContext* c, const uint8_t* frame, char *tc
>      // is only relevant for NTSC systems.
>      int prevent_df = c->sys->ltc_divisor == 25 || c->sys->ltc_divisor == 50;
>  
> -    tc_pack = dv_extract_pack(frame, dv_timecode);
> +    tc_pack = dv_extract_pack(frame, DV_TIMECODE);
>      if (!tc_pack)
>          return 0;
>      av_timecode_make_smpte_tc_string2(tc, av_inv_q(c->sys->time_base), AV_RB32(tc_pack + 1), prevent_df, 1);
> diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
> index 429ddcb96c..11947aa493 100644
> --- a/libavformat/dvenc.c
> +++ b/libavformat/dvenc.c
> @@ -94,7 +94,7 @@ static int dv_audio_frame_size(const AVDVProfile* sys, int frame, int sample_rat
>                                              sizeof(sys->audio_samples_dist[0]))];
>  }
>  
> -static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* buf, int channel, int seq)
> +static int dv_write_pack(enum DVPackType pack_id, DVMuxContext *c, uint8_t* buf, int channel, int seq)
>  {
>      struct tm tc;
>      time_t ct;
> @@ -103,12 +103,12 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
>  
>      buf[0] = (uint8_t)pack_id;
>      switch (pack_id) {
> -    case dv_timecode:
> +    case DV_TIMECODE:
>          timecode  = av_timecode_get_smpte_from_framenum(&c->tc, c->frames);
>          timecode |= 1<<23 | 1<<15 | 1<<7 | 1<<6; // biphase and binary group flags
>          AV_WB32(buf + 1, timecode);
>          break;
> -    case dv_audio_source:  /* AAUX source pack */
> +    case DV_AUDIO_SOURCE:  /* AAUX source pack */
>          if (c->ast[channel]->codecpar->sample_rate == 44100) {
>              audio_type = 1;
>          } else if (c->ast[channel]->codecpar->sample_rate == 32000)
> @@ -132,7 +132,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
>                    0;        /* quantization: 0 -- 16-bit linear, 1 -- 12-bit nonlinear */
>  
>          break;
> -    case dv_audio_control:
> +    case DV_AUDIO_CONTROL:
>          buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */
>                   (1 << 4) | /* input source: 1 -- digital input */
>                   (3 << 2) | /* compression: 3 -- no information */
> @@ -147,8 +147,8 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
>          buf[4] = (1 << 7) | /* reserved -- always 1 */
>                    0x7f;     /* genre category */
>          break;
> -    case dv_audio_recdate:
> -    case dv_video_recdate:  /* VAUX recording date */
> +    case DV_AUDIO_RECDATE:
> +    case DV_VIDEO_RECDATE:  /* VAUX recording date */
>          ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
>                                              c->sys->time_base.den, AV_ROUND_DOWN);
>          brktimegm(ct, &tc);
> @@ -163,8 +163,8 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
>          buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */
>                   (tc.tm_year % 10);                 /* Units of year */
>          break;
> -    case dv_audio_rectime:  /* AAUX recording time */
> -    case dv_video_rectime:  /* VAUX recording time */
> +    case DV_AUDIO_RECTIME:  /* AAUX recording time */
> +    case DV_VIDEO_RECTIME:  /* VAUX recording time */
>          ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
>                                                         c->sys->time_base.den, AV_ROUND_DOWN);
>          brktimegm(ct, &tc);
> @@ -219,22 +219,22 @@ static void dv_inject_metadata(DVMuxContext *c, uint8_t* frame)
>          /* DV subcode: 2nd and 3d DIFs */
>          for (j = 80; j < 80 * 3; j += 80) {
>              for (k = 6; k < 6 * 8; k += 8)
> -                dv_write_pack(dv_timecode, c, &buf[j+k], 0, seq);
> +                dv_write_pack(DV_TIMECODE, c, &buf[j+k], 0, seq);
>  
>              if (((long)(buf-frame)/(c->sys->frame_size/(c->sys->difseg_size*c->sys->n_difchan))%c->sys->difseg_size) > 5) { /* FIXME: is this really needed ? */
> -                dv_write_pack(dv_video_recdate, c, &buf[j+14], 0, seq);
> -                dv_write_pack(dv_video_rectime, c, &buf[j+22], 0, seq);
> -                dv_write_pack(dv_video_recdate, c, &buf[j+38], 0, seq);
> -                dv_write_pack(dv_video_rectime, c, &buf[j+46], 0, seq);
> +                dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+14], 0, seq);
> +                dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+22], 0, seq);
> +                dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+38], 0, seq);
> +                dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+46], 0, seq);
>              }
>          }
>  
>          /* DV VAUX: 4th, 5th and 6th 3DIFs */
>          for (j = 80*3 + 3; j < 80*6; j += 80) {
> -            dv_write_pack(dv_video_recdate, c, &buf[j+5* 2], 0, seq);
> -            dv_write_pack(dv_video_rectime, c, &buf[j+5* 3], 0, seq);
> -            dv_write_pack(dv_video_recdate, c, &buf[j+5*11], 0, seq);
> -            dv_write_pack(dv_video_rectime, c, &buf[j+5*12], 0, seq);
> +            dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+5* 2], 0, seq);
> +            dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+5* 3], 0, seq);
> +            dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+5*11], 0, seq);
> +            dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+5*12], 0, seq);
>          }
>      }
>  }

LGTM.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/dv.h b/libavcodec/dv.h
index 535f01cf0b..29f97b6089 100644
--- a/libavcodec/dv.h
+++ b/libavcodec/dv.h
@@ -27,27 +27,27 @@ 
 #ifndef AVCODEC_DV_H
 #define AVCODEC_DV_H
 
-enum dv_section_type {
-    dv_sect_header  = 0x1f,
-    dv_sect_subcode = 0x3f,
-    dv_sect_vaux    = 0x56,
-    dv_sect_audio   = 0x76,
-    dv_sect_video   = 0x96,
+enum DVSectionType {
+    DV_SECT_HEADER  = 0x1f,
+    DV_SECT_SUBCODE = 0x3f,
+    DV_SECT_VAUX    = 0x56,
+    DV_SECT_AUDIO   = 0x76,
+    DV_SECT_VIDEO   = 0x96,
 };
 
-enum dv_pack_type {
-    dv_header525     = 0x3f,  /* see dv_write_pack for important details on */
-    dv_header625     = 0xbf,  /* these two packs */
-    dv_timecode      = 0x13,
-    dv_audio_source  = 0x50,
-    dv_audio_control = 0x51,
-    dv_audio_recdate = 0x52,
-    dv_audio_rectime = 0x53,
-    dv_video_source  = 0x60,
-    dv_video_control = 0x61,
-    dv_video_recdate = 0x62,
-    dv_video_rectime = 0x63,
-    dv_unknown_pack  = 0xff,
+enum DVPackType {
+    DV_HEADER525     = 0x3f,  /* see dv_write_pack for important details on */
+    DV_HEADER625     = 0xbf,  /* these two packs */
+    DV_TIMECODE      = 0x13,
+    DV_AUDIO_SOURCE  = 0x50,
+    DV_AUDIO_CONTROL = 0x51,
+    DV_AUDIO_RECDATE = 0x52,
+    DV_AUDIO_RECTIME = 0x53,
+    DV_VIDEO_SOURCE  = 0x60,
+    DV_VIDEO_CONTROL = 0x61,
+    DV_VIDEO_RECDATE = 0x62,
+    DV_VIDEO_RECTIME = 0x63,
+    DV_UNKNOWN_PACK  = 0xff,
 };
 
 #define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10)
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 297bf7f2fb..424aa79f35 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -662,7 +662,7 @@  static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     /* Determine the codec's sample_aspect ratio from the packet */
     vsc_pack = buf + 80 * 5 + 48 + 5;
-    if (*vsc_pack == dv_video_control) {
+    if (*vsc_pack == DV_VIDEO_CONTROL) {
         apt    = buf[4] & 0x07;
         is16_9 = (vsc_pack[2] & 0x07) == 0x02 ||
                  (!apt && (vsc_pack[2] & 0x07) == 0x07);
@@ -673,7 +673,7 @@  static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
         return ret;
 
     /* Determine the codec's field order from the packet */
-    if ( *vsc_pack == dv_video_control ) {
+    if ( *vsc_pack == DV_VIDEO_CONTROL ) {
         if (avctx->height == 720) {
             frame->interlaced_frame = 0;
             frame->top_field_first = 0;
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 1f0374b865..c0ae4c040a 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -1013,7 +1013,7 @@  static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
     return 0;
 }
 
-static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
+static inline int dv_write_pack(enum DVPackType pack_id, DVEncContext *c,
                                 uint8_t *buf)
 {
     /*
@@ -1051,8 +1051,8 @@  static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
 
     buf[0] = (uint8_t) pack_id;
     switch (pack_id) {
-    case dv_header525: /* I can't imagine why these two weren't defined as real */
-    case dv_header625: /* packs in SMPTE314M -- they definitely look like ones */
+    case DV_HEADER525: /* I can't imagine why these two weren't defined as real */
+    case DV_HEADER625: /* packs in SMPTE314M -- they definitely look like ones */
         buf[1] =  0xf8       | /* reserved -- always 1 */
                  (apt & 0x07); /* APT: Track application ID */
         buf[2] = (0    << 7) | /* TF1: audio data is 0 - valid; 1 - invalid */
@@ -1065,7 +1065,7 @@  static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
                  (0x0f << 3) | /* reserved -- always 1 */
                  (apt & 0x07); /* AP3: Subcode application ID */
         break;
-    case dv_video_source:
+    case DV_VIDEO_SOURCE:
         buf[1] = 0xff;         /* reserved -- always 1 */
         buf[2] = (1 << 7) |    /* B/W: 0 - b/w, 1 - color */
                  (1 << 6) |    /* following CLF is valid - 0, invalid - 1 */
@@ -1076,7 +1076,7 @@  static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
                  c->sys->video_stype; /* signal type video compression */
         buf[4] = 0xff;         /* VISC: 0xff -- no information */
         break;
-    case dv_video_control:
+    case DV_VIDEO_CONTROL:
         buf[1] = (0 << 6) |    /* Copy generation management (CGMS) 0 -- free */
                  0x3f;         /* reserved -- always 1 */
         buf[2] = 0xc8 |        /* reserved -- always b11001xxx */
@@ -1097,7 +1097,7 @@  static inline int dv_write_pack(enum dv_pack_type pack_id, DVEncContext *c,
     return 5;
 }
 
-static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num,
+static inline int dv_write_dif_id(enum DVSectionType t, uint8_t chan_num,
                                   uint8_t seq_num, uint8_t dif_num,
                                   uint8_t *buf)
 {
@@ -1144,14 +1144,14 @@  static void dv_format_frame(DVEncContext *c, uint8_t *buf)
             memset(buf, 0xff, 80 * 6); /* first 6 DIF blocks are for control data */
 
             /* DV header: 1DIF */
-            buf += dv_write_dif_id(dv_sect_header, chan+chan_offset, i, 0, buf);
-            buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525),
+            buf += dv_write_dif_id(DV_SECT_HEADER, chan+chan_offset, i, 0, buf);
+            buf += dv_write_pack((c->sys->dsf ? DV_HEADER625 : DV_HEADER525),
                                  c, buf);
             buf += 72; /* unused bytes */
 
             /* DV subcode: 2DIFs */
             for (j = 0; j < 2; j++) {
-                buf += dv_write_dif_id(dv_sect_subcode, chan+chan_offset, i, j, buf);
+                buf += dv_write_dif_id(DV_SECT_SUBCODE, chan+chan_offset, i, j, buf);
                 for (k = 0; k < 6; k++)
                     buf += dv_write_ssyb_id(k, (i < c->sys->difseg_size / 2), buf) + 5;
                 buf += 29; /* unused bytes */
@@ -1159,12 +1159,12 @@  static void dv_format_frame(DVEncContext *c, uint8_t *buf)
 
             /* DV VAUX: 3DIFS */
             for (j = 0; j < 3; j++) {
-                buf += dv_write_dif_id(dv_sect_vaux, chan+chan_offset, i, j, buf);
-                buf += dv_write_pack(dv_video_source,  c, buf);
-                buf += dv_write_pack(dv_video_control, c, buf);
+                buf += dv_write_dif_id(DV_SECT_VAUX, chan+chan_offset, i, j, buf);
+                buf += dv_write_pack(DV_VIDEO_SOURCE,  c, buf);
+                buf += dv_write_pack(DV_VIDEO_CONTROL, c, buf);
                 buf += 7 * 5;
-                buf += dv_write_pack(dv_video_source,  c, buf);
-                buf += dv_write_pack(dv_video_control, c, buf);
+                buf += dv_write_pack(DV_VIDEO_SOURCE,  c, buf);
+                buf += dv_write_pack(DV_VIDEO_CONTROL, c, buf);
                 buf += 4 * 5 + 2; /* unused bytes */
             }
 
@@ -1172,10 +1172,10 @@  static void dv_format_frame(DVEncContext *c, uint8_t *buf)
             for (j = 0; j < 135; j++) {
                 if (j % 15 == 0) {
                     memset(buf, 0xff, 80);
-                    buf += dv_write_dif_id(dv_sect_audio, chan+chan_offset, i, j/15, buf);
+                    buf += dv_write_dif_id(DV_SECT_AUDIO, chan+chan_offset, i, j/15, buf);
                     buf += 77; /* audio control & shuffled PCM audio */
                 }
-                buf += dv_write_dif_id(dv_sect_video, chan+chan_offset, i, j, buf);
+                buf += dv_write_dif_id(DV_SECT_VIDEO, chan+chan_offset, i, j, buf);
                 buf += 77; /* 1 video macroblock: 1 bytes control
                             * 4 * 14 bytes Y 8x8 data
                             * 10 bytes Cr 8x8 data
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 24bacd5c53..303cecf9bb 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -87,26 +87,26 @@  static inline uint16_t dv_audio_12to16(uint16_t sample)
     return result;
 }
 
-static const uint8_t *dv_extract_pack(const uint8_t *frame, enum dv_pack_type t)
+static const uint8_t *dv_extract_pack(const uint8_t *frame, enum DVPackType t)
 {
     int offs;
     int c;
 
     for (c = 0; c < 10; c++) {
         switch (t) {
-        case dv_audio_source:
+        case DV_AUDIO_SOURCE:
             if (c&1)    offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000);
             else        offs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000);
             break;
-        case dv_audio_control:
+        case DV_AUDIO_CONTROL:
             if (c&1)    offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000);
             else        offs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000);
             break;
-        case dv_video_control:
+        case DV_VIDEO_CONTROL:
             if (c&1)    offs = (80 * 3 + 8      + c*12000);
             else        offs = (80 * 5 + 48 + 5 + c*12000);
             break;
-        case dv_timecode:
+        case DV_TIMECODE:
             offs = (80*1 + 3 + 3);
             break;
         default:
@@ -139,7 +139,7 @@  static int dv_extract_audio(const uint8_t *frame, uint8_t **ppcm,
     const uint8_t *as_pack;
     uint8_t *pcm, ipcm;
 
-    as_pack = dv_extract_pack(frame, dv_audio_source);
+    as_pack = dv_extract_pack(frame, DV_AUDIO_SOURCE);
     if (!as_pack)    /* No audio ? */
         return 0;
 
@@ -239,7 +239,7 @@  static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame)
     const uint8_t *as_pack;
     int freq, stype, smpls, quant, i, ach;
 
-    as_pack = dv_extract_pack(frame, dv_audio_source);
+    as_pack = dv_extract_pack(frame, DV_AUDIO_SOURCE);
     if (!as_pack || !c->sys) {    /* No audio ? */
         c->ach = 0;
         return 0;
@@ -308,7 +308,7 @@  static int dv_extract_video_info(DVDemuxContext *c, const uint8_t *frame)
     c->vst->avg_frame_rate = av_inv_q(c->vst->time_base);
 
     /* finding out SAR is a little bit messy */
-    vsc_pack = dv_extract_pack(frame, dv_video_control);
+    vsc_pack = dv_extract_pack(frame, DV_VIDEO_CONTROL);
     apt      = frame[4] & 0x07;
     is16_9   = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
                              (!apt && (vsc_pack[2] & 0x07) == 0x07)));
@@ -328,7 +328,7 @@  static int dv_extract_timecode(DVDemuxContext* c, const uint8_t* frame, char *tc
     // is only relevant for NTSC systems.
     int prevent_df = c->sys->ltc_divisor == 25 || c->sys->ltc_divisor == 50;
 
-    tc_pack = dv_extract_pack(frame, dv_timecode);
+    tc_pack = dv_extract_pack(frame, DV_TIMECODE);
     if (!tc_pack)
         return 0;
     av_timecode_make_smpte_tc_string2(tc, av_inv_q(c->sys->time_base), AV_RB32(tc_pack + 1), prevent_df, 1);
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 429ddcb96c..11947aa493 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -94,7 +94,7 @@  static int dv_audio_frame_size(const AVDVProfile* sys, int frame, int sample_rat
                                             sizeof(sys->audio_samples_dist[0]))];
 }
 
-static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* buf, int channel, int seq)
+static int dv_write_pack(enum DVPackType pack_id, DVMuxContext *c, uint8_t* buf, int channel, int seq)
 {
     struct tm tc;
     time_t ct;
@@ -103,12 +103,12 @@  static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
 
     buf[0] = (uint8_t)pack_id;
     switch (pack_id) {
-    case dv_timecode:
+    case DV_TIMECODE:
         timecode  = av_timecode_get_smpte_from_framenum(&c->tc, c->frames);
         timecode |= 1<<23 | 1<<15 | 1<<7 | 1<<6; // biphase and binary group flags
         AV_WB32(buf + 1, timecode);
         break;
-    case dv_audio_source:  /* AAUX source pack */
+    case DV_AUDIO_SOURCE:  /* AAUX source pack */
         if (c->ast[channel]->codecpar->sample_rate == 44100) {
             audio_type = 1;
         } else if (c->ast[channel]->codecpar->sample_rate == 32000)
@@ -132,7 +132,7 @@  static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
                   0;        /* quantization: 0 -- 16-bit linear, 1 -- 12-bit nonlinear */
 
         break;
-    case dv_audio_control:
+    case DV_AUDIO_CONTROL:
         buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */
                  (1 << 4) | /* input source: 1 -- digital input */
                  (3 << 2) | /* compression: 3 -- no information */
@@ -147,8 +147,8 @@  static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
         buf[4] = (1 << 7) | /* reserved -- always 1 */
                   0x7f;     /* genre category */
         break;
-    case dv_audio_recdate:
-    case dv_video_recdate:  /* VAUX recording date */
+    case DV_AUDIO_RECDATE:
+    case DV_VIDEO_RECDATE:  /* VAUX recording date */
         ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
                                             c->sys->time_base.den, AV_ROUND_DOWN);
         brktimegm(ct, &tc);
@@ -163,8 +163,8 @@  static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
         buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */
                  (tc.tm_year % 10);                 /* Units of year */
         break;
-    case dv_audio_rectime:  /* AAUX recording time */
-    case dv_video_rectime:  /* VAUX recording time */
+    case DV_AUDIO_RECTIME:  /* AAUX recording time */
+    case DV_VIDEO_RECTIME:  /* VAUX recording time */
         ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
                                                        c->sys->time_base.den, AV_ROUND_DOWN);
         brktimegm(ct, &tc);
@@ -219,22 +219,22 @@  static void dv_inject_metadata(DVMuxContext *c, uint8_t* frame)
         /* DV subcode: 2nd and 3d DIFs */
         for (j = 80; j < 80 * 3; j += 80) {
             for (k = 6; k < 6 * 8; k += 8)
-                dv_write_pack(dv_timecode, c, &buf[j+k], 0, seq);
+                dv_write_pack(DV_TIMECODE, c, &buf[j+k], 0, seq);
 
             if (((long)(buf-frame)/(c->sys->frame_size/(c->sys->difseg_size*c->sys->n_difchan))%c->sys->difseg_size) > 5) { /* FIXME: is this really needed ? */
-                dv_write_pack(dv_video_recdate, c, &buf[j+14], 0, seq);
-                dv_write_pack(dv_video_rectime, c, &buf[j+22], 0, seq);
-                dv_write_pack(dv_video_recdate, c, &buf[j+38], 0, seq);
-                dv_write_pack(dv_video_rectime, c, &buf[j+46], 0, seq);
+                dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+14], 0, seq);
+                dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+22], 0, seq);
+                dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+38], 0, seq);
+                dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+46], 0, seq);
             }
         }
 
         /* DV VAUX: 4th, 5th and 6th 3DIFs */
         for (j = 80*3 + 3; j < 80*6; j += 80) {
-            dv_write_pack(dv_video_recdate, c, &buf[j+5* 2], 0, seq);
-            dv_write_pack(dv_video_rectime, c, &buf[j+5* 3], 0, seq);
-            dv_write_pack(dv_video_recdate, c, &buf[j+5*11], 0, seq);
-            dv_write_pack(dv_video_rectime, c, &buf[j+5*12], 0, seq);
+            dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+5* 2], 0, seq);
+            dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+5* 3], 0, seq);
+            dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+5*11], 0, seq);
+            dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+5*12], 0, seq);
         }
     }
 }