forked from opdenkamp/xbmc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c0d14e
commit b0ec419
Showing
14 changed files
with
616 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* HW decode acceleration for MPEG-2, H.264 and VC-1 | ||
* | ||
* Copyright (C) 2005-2011 Team XBMC | ||
* | ||
* This file is part of FFmpeg. | ||
* | ||
* FFmpeg is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* FFmpeg is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with FFmpeg; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
|
||
/** | ||
* \addtogroup XVBA_Decoding | ||
* | ||
* @{ | ||
*/ | ||
|
||
#include <stdint.h> | ||
#include "xvba.h" | ||
#include "avcodec.h" | ||
|
||
int ff_xvba_translate_profile(int profile) { | ||
|
||
if (profile == 66) | ||
return 1; | ||
else if (profile == 77) | ||
return 2; | ||
else if (profile == 100) | ||
return 3; | ||
else if (profile == 0) | ||
return 4; | ||
else if (profile == 1) | ||
return 5; | ||
else if (profile == 3) | ||
return 6; | ||
else | ||
return -1; | ||
} | ||
|
||
void ff_xvba_add_slice_data(struct xvba_render_state *render, const void *buffer, uint32_t size) { | ||
|
||
render->buffers = av_fast_realloc( | ||
render->buffers, | ||
&render->buffers_alllocated, | ||
sizeof(struct xvba_bitstream_buffers)*(render->num_slices + 1) | ||
); | ||
|
||
render->buffers[render->num_slices].buffer = buffer; | ||
render->buffers[render->num_slices].size = size; | ||
|
||
render->num_slices++; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* HW decode acceleration for MPEG-2, H.264 and VC-1 | ||
* | ||
* Copyright (C) 2005-2011 Team XBMC | ||
* | ||
* This file is part of FFmpeg. | ||
* | ||
* FFmpeg is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* FFmpeg is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with FFmpeg; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#ifndef AVCODEC_XVBA_H | ||
#define AVCODEC_XVBA_H | ||
|
||
#include <stdint.h> | ||
#include <X11/Xlib.h> | ||
#include <amd/amdxvba.h> | ||
|
||
|
||
/** | ||
* \defgroup XVBA_Decoding VA API Decoding | ||
* \ingroup Decoder | ||
* @{ | ||
*/ | ||
|
||
/** \brief The videoSurface is used for rendering. */ | ||
#define FF_XVBA_STATE_USED_FOR_RENDER 1 | ||
|
||
/** | ||
* \brief The videoSurface is needed for reference/prediction. | ||
* The codec manipulates this. | ||
*/ | ||
#define FF_XVBA_STATE_USED_FOR_REFERENCE 2 | ||
|
||
/** | ||
* \brief The videoSurface holds a decoded frame. | ||
* The codec manipulates this. | ||
*/ | ||
#define FF_XVBA_STATE_DECODED 4 | ||
|
||
/* @} */ | ||
|
||
struct xvba_bitstream_buffers | ||
{ | ||
const void *buffer; | ||
unsigned int size; | ||
}; | ||
|
||
struct xvba_render_state { | ||
|
||
int state; ///< Holds FF_XVBA_STATE_* values. | ||
void *surface; | ||
XVBAPictureDescriptor *picture_descriptor; | ||
XVBAQuantMatrixAvc *iq_matrix; | ||
int num_slices; | ||
struct xvba_bitstream_buffers *buffers; | ||
uint32_t buffers_alllocated; | ||
}; | ||
|
||
#endif /* AVCODEC_XVBA_H */ |
Oops, something went wrong.